summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-10-20 21:23:33 +0200
committerBram Moolenaar <Bram@vim.org>2010-10-20 21:23:33 +0200
commitbd743259603a5cda418a0c542b719dad0213e1a9 (patch)
treef61707a813b850930460aa0605c68037e31291c3 /runtime
parent727c876b7869050d5da4f4d3dba975350bdbd7d8 (diff)
downloadvim-git-bd743259603a5cda418a0c542b719dad0213e1a9.tar.gz
updated for version 7.3.032v7.3.032
Problem: maparg() doesn't return the flags, such as <buffer>, <script>, <silent>. These are needed to save and restore a mapping. Solution: Improve maparg(). (also by Christian Brabandt)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt44
1 files changed, 36 insertions, 8 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d37fe2ab3..d1a1ba3f2 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1827,7 +1827,7 @@ localtime() Number current time
log( {expr}) Float natural logarithm (base e) of {expr}
log10( {expr}) Float logarithm of Float {expr} to base 10
map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
-maparg( {name}[, {mode} [, {abbr}]])
+maparg( {name}[, {mode} [, {abbr} [, {dict}]]])
String rhs of mapping {name} in mode {mode}
mapcheck( {name}[, {mode} [, {abbr}]])
String check for mappings matching {name}
@@ -3972,23 +3972,51 @@ map({expr}, {string}) *map()*
further items in {expr} are processed.
-maparg({name}[, {mode} [, {abbr}]]) *maparg()*
- Return the rhs of mapping {name} in mode {mode}. When there
- is no mapping for {name}, an empty String is returned.
+maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
+ When {dict} is omitted or zero: Return the rhs of mapping
+ {name} in mode {mode}. The returned String has special
+ characters translated like in the output of the ":map" command
+ listing.
+
+ When there is no mapping for {name}, an empty String is
+ returned.
+
+ The {name} can have special key names, like in the ":map"
+ command.
+
{mode} can be one of these strings:
"n" Normal
- "v" Visual
+ "v" Visual (including Select)
"o" Operator-pending
"i" Insert
"c" Cmd-line
+ "s" Select
+ "x" Visual
"l" langmap |language-mapping|
"" Normal, Visual and Operator-pending
When {mode} is omitted, the modes for "" are used.
+
When {abbr} is there and it is non-zero use abbreviations
instead of mappings.
- The {name} can have special key names, like in the ":map"
- command. The returned String has special characters
- translated like in the output of the ":map" command listing.
+
+ When {dict} is there and it is non-zero return a dictionary
+ containing all the information of the mapping with the
+ following items:
+ "lhs" The {lhs} of the mapping.
+ "rhs" The {rhs} of the mapping as typed.
+ "silent" 1 for a |:map-silent| mapping, else 0.
+ "noremap" 1 if the {rhs} of the mapping is remappable.
+ "expr" 1 for an expression mapping (|:map-<expr>|).
+ "buffer" 1 for a buffer local mapping (|:map-local|).
+ "mode" Modes for which the mapping is defined. In
+ addition to the modes mentioned above, these
+ characters will be used:
+ " " Normal, Visual and Operator-pending
+ "!" Insert and Commandline mode
+ (|mapmpde-ic|)
+ "sid" the Script local ID, used for <sid> mappings
+ (|<SID>|)
+
The mappings local to the current buffer are checked first,
then the global mappings.
This function can be used to map a key even when it's already