From 4c70ee02566401ba525d91cede95694fa77cd959 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 29 May 2026 08:46:33 +0800 Subject: [PATCH] vim-patch:9d5a20e: runtime(doc): Clarify the use of mappings related: vim/vim#6705 closes: vim/vim#20351 https://github.com/vim/vim/commit/9d5a20e4409ad47557d6374dd57c88e601b7bf7d Co-authored-by: Enrico Maria De Angelis --- runtime/doc/usr_41.txt | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 85e5dc91ba..66bc8db378 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -2006,9 +2006,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: > - 22 map a TypecorrAdd; + 22 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 "mapleader" variable to the key sequence that they want this mapping to start with. Thus if the user has done: > @@ -2024,15 +2024,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: > - 21 if !hasmapto('TypecorrAdd;') - 22 map a TypecorrAdd; + 21 if !hasmapto('(TypecorrAdd)') + 22 map a (TypecorrAdd) 23 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". @@ -2062,13 +2062,13 @@ function (without the "s:"), 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: > - 24 noremap