aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-01 22:19:30 +0800
committerGitHub <noreply@github.com>2022-08-01 22:19:30 +0800
commit8d1c55e4224fc990d18409905aeb51d54d9d78cb (patch)
treebb4379bde6144ab7a0e2436149730a276c3089d0 /runtime
parentdb6e93c48df551e2906c9e0f4472f9e54cea3dd9 (diff)
parentd954e8da62faccd468896baf2fe06107196cf952 (diff)
downloadrneovim-8d1c55e4224fc990d18409905aeb51d54d9d78cb.tar.gz
rneovim-8d1c55e4224fc990d18409905aeb51d54d9d78cb.tar.bz2
rneovim-8d1c55e4224fc990d18409905aeb51d54d9d78cb.zip
Merge pull request #19602 from zeertzjq/vim-8.2.0807
vim-patch:8.2.{0807,0809,0812,0815,0832,1773,2804,4831,5106},9.0.0127: first part of mapset()
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt27
1 files changed, 26 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index f844ae5aaf..e2a8e098d2 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -295,6 +295,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
rhs of mapping {name} in mode {mode}
mapcheck({name} [, {mode} [, {abbr}]])
String check for mappings matching {name}
+mapset({mode}, {abbr}, {dict})
+ none restore mapping from |maparg()| result
match({expr}, {pat} [, {start} [, {count}]])
Number position where {pat} matches in {expr}
matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
@@ -4716,6 +4718,7 @@ map({expr1}, {expr2}) *map()*
Can also be used as a |method|: >
mylist->map(expr2)
+
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
@@ -4749,7 +4752,10 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
When {dict} is there and it is |TRUE| return a dictionary
containing all the information of the mapping with the
following items:
- "lhs" The {lhs} of the mapping.
+ "lhs" The {lhs} of the mapping as it would be typed
+ "lhsraw" The {lhs} of the mapping as raw bytes
+ "lhsrawalt" The {lhs} of the mapping as raw bytes, alternate
+ form, only present when it differs from "lhsraw"
"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 not remappable.
@@ -4768,6 +4774,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
"nowait" Do not wait for other, longer mappings.
(|:map-<nowait>|).
+ The dictionary can be used to restore a mapping with
+ |mapset()|.
+
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
@@ -4813,6 +4822,22 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
Can also be used as a |method|: >
GetKey()->mapcheck('n')
+mapset({mode}, {abbr}, {dict}) *mapset()*
+ Restore a mapping from a dictionary returned by |maparg()|.
+ {mode} and {abbr} should be the same as for the call to
+ |maparg()|. *E460*
+ {mode} is used to define the mode in which the mapping is set,
+ not the "mode" entry in {dict}.
+ Example for saving and restoring a mapping: >
+ let save_map = maparg('K', 'n', 0, 1)
+ nnoremap K somethingelse
+ ...
+ call mapset('n', 0, save_map)
+< Note that if you are going to replace a map in several modes,
+ e.g. with `:map!`, you need to save the mapping for all of
+ them, since they can differe.
+
+
match({expr}, {pat} [, {start} [, {count}]]) *match()*
When {expr} is a |List| then this returns the index of the
first item where {pat} matches. Each item is used as a