updated for version 7.0220
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2006 Mar 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -145,6 +145,9 @@ type "a", then "bar" will get inserted.
|
||||
|
||||
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
||||
|
||||
"<buffer>", "<silent>", "<script>", "<expr>" and "<unique>" can be used in any
|
||||
order. They must appear right after the command, before any other arguments.
|
||||
|
||||
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||
If the first argument to one of these commands is "<buffer>" it will apply to
|
||||
mappings locally to the current buffer only. Example: >
|
||||
@ -194,8 +197,35 @@ Example of what will fail: >
|
||||
If you want to map a key and then have it do what it was originally mapped to,
|
||||
have a look at |maparg()|.
|
||||
|
||||
"<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order.
|
||||
They must appear right after the command, before any other arguments.
|
||||
*:map-<expr>* *:map-expression*
|
||||
If the first argument to one of these commands is "<expr>" and it is used to
|
||||
define a new mapping or abbreviation, the argument is an expression. The
|
||||
expression is evaluated to obtain the {rhs} that is used. Example: >
|
||||
:inoremap <expr> . InsertDot()
|
||||
The result of the InsertDot() function will be inserted. It could check the
|
||||
text before the cursor and start omni completion when some condition is met.
|
||||
|
||||
Be very careful about side effects! The expression is evaluated while
|
||||
obtaining characters, if you change buffer text, move the cursor, edit another
|
||||
file, etc. you may very well make command disfunctional.
|
||||
|
||||
Here is an example that inserts a list number that increases: >
|
||||
let counter = 0
|
||||
inoremap <expr> <C-L> ListItem()
|
||||
inoremap <expr> <C-R> ListReset()
|
||||
|
||||
func ListItem()
|
||||
let g:counter += 1
|
||||
return g:counter . '. '
|
||||
endfunc
|
||||
|
||||
func ListReset()
|
||||
let g:counter = 0
|
||||
return ''
|
||||
endfunc
|
||||
|
||||
CTRL-L inserts the next number, CTRL-E resets the count. CTRL-E returns an
|
||||
empty string, so that nothing is inserted.
|
||||
|
||||
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Mar 05
|
||||
" Last Change: 2006 Mar 10
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
@ -1163,6 +1163,8 @@ if has("multi_byte")
|
||||
call <SID>OptionG("ccv", &ccv)
|
||||
call append("$", "delcombine\tDelete combining (composing) characters on their own")
|
||||
call <SID>BinOptionG("deco", &deco)
|
||||
call append("$", "maxcombine\tMaximum number of combining (composing) characters displayed")
|
||||
call <SID>OptionG("mco", &mco)
|
||||
if has("xim") && has("gui_gtk")
|
||||
call append("$", "imactivatekey\tkey that activates the X input method")
|
||||
call <SID>OptionG("imak", &imak)
|
||||
|
||||
Reference in New Issue
Block a user