mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #17557 from zeertzjq/clarify-plug
docs: clarify actual behavior of <Plug>
This commit is contained in:
commit
01139ec82c
@ -65,9 +65,8 @@ modes.
|
|||||||
where the map command applies. Disallow mapping of
|
where the map command applies. Disallow mapping of
|
||||||
{rhs}, to avoid nested and recursive mappings. Often
|
{rhs}, to avoid nested and recursive mappings. Often
|
||||||
used to redefine a command.
|
used to redefine a command.
|
||||||
Note: "nore" is ignored for a mapping whose result
|
Note: A mapping whose {lhs} starts with <Plug> is
|
||||||
starts with <Plug>. <Plug> is always remapped even if
|
always applied even if mapping is disallowed.
|
||||||
"nore" is used.
|
|
||||||
|
|
||||||
|
|
||||||
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
||||||
|
@ -358,6 +358,10 @@ Macro/|recording| behavior
|
|||||||
macros and 'keymap' at the same time. This also means you can use |:imap| on
|
macros and 'keymap' at the same time. This also means you can use |:imap| on
|
||||||
the results of keys from 'keymap'.
|
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:
|
Motion:
|
||||||
The |jumplist| avoids useless/phantom jumps.
|
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
|
- `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.
|
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*
|
5. Missing legacy features *nvim-features-missing*
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ describe(':*map', function()
|
|||||||
expect('-foo-')
|
expect('-foo-')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('<Plug> keymaps ignore nore', function()
|
it('<Plug> mappings ignore nore', function()
|
||||||
command('let x = 0')
|
command('let x = 0')
|
||||||
eq(0, meths.eval('x'))
|
eq(0, meths.eval('x'))
|
||||||
command [[
|
command [[
|
||||||
@ -43,7 +43,8 @@ describe(':*map', function()
|
|||||||
feed('increase_x_noremap')
|
feed('increase_x_noremap')
|
||||||
eq(2, meths.eval('x'))
|
eq(2, meths.eval('x'))
|
||||||
end)
|
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')
|
command('let x = 0')
|
||||||
eq(0, meths.eval('x'))
|
eq(0, meths.eval('x'))
|
||||||
command [[
|
command [[
|
||||||
|
Loading…
Reference in New Issue
Block a user