*smartchr.txt* Insert several candidates with a single key
Version 0.0.1
Script ID: 2290
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 *smartchr-contents*
Introduction |smartchr-introduction|
Interface |smartchr-interface|
Functions |smartchr-functions|
Bugs |smartchr-bugs|
Changelog |smartchr-changelog|
==============================================================================
INTRODUCTION *smartchr-introduction*
*smartchr* is a Vim plugin to support input several candidates with a single
key, like ess-smart-underscore in Emacs Speaks Statistics -- when user types
"_" key, it inserts " <- " for the first time or it replaces " <- " by "_" for
the second time. This plugin provides a function to support to define such
key bindings.
Requirements:
- Vim 7.1 or later
Latest version:
http://github.com/kana/config/commits/vim-smartchar
Document in HTML format:
http://kana.github.com/config/vim/smartchr.html
==============================================================================
INTERFACE *smartchr-interface*
------------------------------------------------------------------------------
FUNCTIONS *smartchr-functions*
*smartchr#loop()*
smartchr#loop(...)
Same as |smartchr#one_of()|, but it returns the key sequence to
replace the {N}th argument by the 1st argument for the {N+1}th time.
For example,
>
<
With the above setting, whenever user types "_" key:
- " <- " is inserted for the 1st time, or
- the previously inserted " <- " is removed then "_" is inserted for
the 2nd time, or
- the previously inserted "_" is removed then " <- " is inserted for
the 3rd time, and so forth.
*smartchr#one_of()*
smartchr#one_of(...)
Returns a string which represents the key sequence to insert one of
the given arguments. For example, the following setting emulates
ess-smart-underscore in Emacs Speaks Statistics:
>
<
With the above setting, whenever user types "_" key:
- " <- " is inserted for the 1st time, or
- the previously inserted " <- " is removed then "_" is inserted for
the 2nd time.
More generally, this function returns the key sequence to:
- insert the 1st argument for the 1st time, or
- replace the 1st argument by the 2nd argument for the 2nd time, or
- ...
- replace the {N-1}th argument by the {N}th argument for the {N}th
time.
==============================================================================
BUGS *smartchr-bugs*
- There are many bugs around the world.
==============================================================================
CHANGELOG *smartchr-changelog*
0.0.1 2008-08-28T12:39:07+09:00 *smartchr-changelog-0.0.1*
- Add |smartchr#loop()|.
0.0.0 2008-07-11T11:55:47+09:00 *smartchr-changelog-0.0.0*
- Initial version.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: