neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 01139ec82ccea53ac631a41cbc46d3c440ec907b
parent cf0266fae1b24ced577dfb8673c11efd4ceb1627
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Tue,  1 Mar 2022 09:44:40 +0800

Merge pull request #17557 from zeertzjq/clarify-plug

docs: clarify actual behavior of <Plug>
Diffstat:
Mruntime/doc/map.txt | 5++---
Mruntime/doc/vim_diff.txt | 7++++---
Mtest/functional/ex_cmds/map_spec.lua | 5+++--
3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt @@ -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* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt @@ -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* diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua @@ -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 [[