From: Enrico Maria De Angelis Date: Thu, 28 May 2026 18:31:33 +0000 (+0000) Subject: runtime(doc): Clarify the use of mappings X-Git-Tag: v9.2.0546~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d5a20e4409ad47557d6374dd57c88e601b7bf7d;p=thirdparty%2Fvim.git runtime(doc): Clarify the use of mappings related: #6705 closes: #20351 Signed-off-by: Enrico Maria De Angelis Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/usr_51.txt b/runtime/doc/usr_51.txt index b1b630454d..1ed1b6b376 100644 --- a/runtime/doc/usr_51.txt +++ b/runtime/doc/usr_51.txt @@ -1,4 +1,4 @@ -*usr_51.txt* For Vim version 9.2. Last change: 2026 May 26 +*usr_51.txt* For Vim version 9.2. Last change: 2026 May 28 VIM USER MANUAL by Bram Moolenaar @@ -134,9 +134,9 @@ for this mapping, but the user might already use it for something else. To allow the user to define which keys a mapping in a plugin uses, the item can be used: > - 20 map a TypecorrAdd; + 20 map a (TypecorrAdd) -The "TypecorrAdd;" thing will do the work, more about that further on. +The "(TypecorrAdd)" thing will do the work, more about that further on. The user can set the "g:mapleader" variable to the key sequence that they want plugin mappings to start with. Thus if the user has done: > @@ -152,15 +152,15 @@ already happened to exist. |:map-| But what if the user wants to define their own key sequence? We can allow that with this mechanism: > - 19 if !hasmapto('TypecorrAdd;') - 20 map a TypecorrAdd; + 19 if !hasmapto('(TypecorrAdd)') + 20 map a (TypecorrAdd) 21 endif -This checks if a mapping to "TypecorrAdd;" already exists, and only +This checks if a mapping to "(TypecorrAdd)" already exists, and only defines the mapping from "a" if it doesn't. The user then has a chance of putting this in their vimrc file: > - map ,c TypecorrAdd; + map ,c (TypecorrAdd) Then the mapped key sequence will be ",c" instead of "_a" or "\a". @@ -191,13 +191,13 @@ which is again another function. can be used with mappings. It generates a script ID, which identifies the current script. In our typing correction plugin we use it like this: > - 22 noremap