diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-01 09:27:36 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-01 09:28:27 +0800 |
commit | 0cb9a577edf04c9be25c6bd97a567e75283b4530 (patch) | |
tree | 1dba3b726fb95eca8147e668eda36f0eb3a4e458 | |
parent | cf0266fae1b24ced577dfb8673c11efd4ceb1627 (diff) | |
download | rneovim-0cb9a577edf04c9be25c6bd97a567e75283b4530.tar.gz rneovim-0cb9a577edf04c9be25c6bd97a567e75283b4530.tar.bz2 rneovim-0cb9a577edf04c9be25c6bd97a567e75283b4530.zip |
docs: clarify actual behavior of <Plug>
-rw-r--r-- | runtime/doc/map.txt | 5 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 7 | ||||
-rw-r--r-- | test/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 index 8d5449da0b..8715c3231c 100644 --- 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 index d7a65756bf..90f56e2566 100644 --- 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 index 007d68d61a..6eeb079f75 100644 --- 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 [[ |