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
commit7484a446bbc3c3c76692b0b264f15d9631f31a6d (patch)
tree754b4d23586ec26beac5fa5020624c3bdbc1f21c /runtime
parent8f8a56ef3b52029fdecd2f5ce111b7a3a7f568f2 (diff)
downloadvim-7484a446bbc3c3c76692b0b264f15d9631f31a6d.tar.gz
updated for version 7.3.032v7.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 d37fe2ab..d1a1ba3f 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