docs: clarify actual behavior of <Plug>

This commit is contained in:
zeertzjq 2022-03-01 09:27:36 +08:00
parent cf0266fae1
commit 0cb9a577ed
3 changed files with 9 additions and 8 deletions

View File

@ -65,9 +65,8 @@ modes.
where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often
used to redefine a command.
Note: "nore" is ignored for a mapping whose result
starts with <Plug>. <Plug> is always remapped even if
"nore" is used.
Note: A mapping whose {lhs} starts with <Plug> is
always applied even if mapping is disallowed.
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*

View File

@ -358,6 +358,10 @@ Macro/|recording| behavior
macros and 'keymap' at the same time. This also means you can use |:imap| on
the results of keys from 'keymap'.
Mappings:
- A mapping whose {lhs} starts with <Plug> is always applied even if mapping
is disallowed by |nore|.
Motion:
The |jumplist| avoids useless/phantom jumps.
@ -442,9 +446,6 @@ Working directory (Vim implemented some of these later than Nvim):
- `getcwd(-1)` is equivalent to `getcwd(-1, 0)` instead of returning the global
working directory. Use `getcwd(-1, -1)` to get the global working directory.
Mappings:
- |nore| is ignored for rhs <Plug> mappings. <Plug> mappings are always remapped.
==============================================================================
5. Missing legacy features *nvim-features-missing*

View File

@ -30,7 +30,7 @@ describe(':*map', function()
expect('-foo-')
end)
it('<Plug> keymaps ignore nore', function()
it('<Plug> mappings ignore nore', function()
command('let x = 0')
eq(0, meths.eval('x'))
command [[
@ -43,7 +43,8 @@ describe(':*map', function()
feed('increase_x_noremap')
eq(2, meths.eval('x'))
end)
it("Doesn't auto ignore nore for keys before or after <Plug> keymap", function()
it("Doesn't auto ignore nore for keys before or after <Plug> mapping", function()
command('let x = 0')
eq(0, meths.eval('x'))
command [[