*smartword.txt* Smart motions on words
Version 0.0.2
Script ID: 2470
Copyright (C) 2008 kana <http://whileimautomaton.net/>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
CONTENTS *smartword-contents*
Introduction |smartword-introduction|
Interface |smartword-interface|
Mappings |smartword-mappings|
Examples |smartword-examples|
Bugs |smartword-bugs|
Changelog |smartword-changelog|
==============================================================================
INTRODUCTION *smartword-introduction*
*smartword* is a Vim plugin to provide {motion}s on |word|s which are smarter
than the built-in ones in some sense. For example, |w| moves the cursor to
the next word as follows (here "#" means a position to which |w| moves the
cursor for each time):
<a href="http://www.vim.org/">www.vim.org</a>
# # # # # # ## ## # # ## ## # #
Because there are two types of words and |w| moves to the next word which can
be the both types. Let's call "L" for a type of words and "P" for another
type of words, where "L" means a word which consists of a sequence of letters
(which are defined by 'iskeyword' option) and "P" means a word which consists
of a sequence of other non-blank characters.
In many cases, you might want to move to the next "L", not "P". This plugin
provides {motion}s to behave so. For example, |<Plug>(smartword-w)| which is
corresponding to |w| moves the cursor as follows:
<a href="http://www.vim.org/">www.vim.org</a>
# # # # # # # # # #
See also |smartword-examples| for customization.
See also the following image if the above figures aren't correctly displayed:
http://gyazo.com/bc7887d9bb0f6aa3eee1e67b0d756b2e.png
Requirements:
- Vim 7.2 or later
Latest version:
http://github.com/kana/config/commits/vim-smartword
Document in HTML format:
http://kana.github.com/config/vim/smartword.html
==============================================================================
INTERFACE *smartword-interface*
------------------------------------------------------------------------------
MAPPINGS *smartword-mappings*
<Plug>(smartword-w) *<Plug>(smartword-w)*
<Plug>(smartword-b) *<Plug>(smartword-b)*
<Plug>(smartword-e) *<Plug>(smartword-e)*
<Plug>(smartword-ge) *<Plug>(smartword-ge)*
Smart versions of |w|, |b|, |e| and |ge|.
These mappings are defined in Normal mode, Visual mode
and Operator-pending mode.
==============================================================================
EXAMPLES *smartword-examples*
(A) Replace |w| and others with |smartword-mappings|:
>
<
(B) Use other key sequences for smart version:
>
<
(C) Keep the default meanings of |w| and others in other key sequences:
>
<
==============================================================================
BUGS *smartword-bugs*
- Don't consider about special cases such as |cw|.
- |o_v| and others don't work for |<Plug>(smartword-e)| and
|<Plug>(smartword-ge)| because of the limitation of Vim script.
Note that if the following patch (*) is applied to Vim, |o_v| and others
work for both motions. But |o_v| with empty selection still doesn't work.
(*) http://github.com/kana/vim/commits/hack/vimvar-motion_force
==============================================================================
CHANGELOG *smartword-changelog*
0.0.2 2009-01-23T19:13:29+09:00 *smartword-changelog-0.0.2*
- Fix the document a bit.
- Revise the treatment on 'iskeyword'.
- Fix 2 bugs on |<Plug>(smartword-e)| and |<Plug>(smartword-ge)| with
|o_v|. These bugs are appeared only in Vim with the patch (*).
0.0.1 2008-12-06T01:21:37+09:00 *smartword-changelog-0.0.1*
- Fix |<Plug>(smartword-e)| and |<Plug>(smartword-ge)| to be
|inclusive| as same as |e| and |ge|.
0.0.0 2008-12-03T01:44:30+09:00 *smartword-changelog-0.0.0*
- Initial version.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: