diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-03-10 21:34:27 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-03-10 21:34:27 +0000 |
commit | 4e42719355b7e1c968c7de0c51588bd744cdf034 (patch) | |
tree | 1632036b89fc3f2492d7ebe4a9b25b1f94c449c9 /runtime | |
parent | 1056d988442648527a45366c9d16523cdc521031 (diff) | |
download | vim-4e42719355b7e1c968c7de0c51588bd744cdf034.zip |
updated for version 7.0220
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/map.txt | 36 | ||||
-rw-r--r-- | runtime/optwin.vim | 4 |
2 files changed, 36 insertions, 4 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 7a194ccb8..228b9a9f9 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -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* diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 8a8cf6f72..7dff51319 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -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) |