aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/keymap.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-02-27 16:47:55 +0100
committerGitHub <noreply@github.com>2022-02-27 16:47:55 +0100
commitc65d93e60adcacded822f0ad5d539042e600f523 (patch)
treefadf4755797c5f7e56bd73250ef29dbd9a745c94 /runtime/lua/vim/keymap.lua
parent243869658e2ecc35b25a37bab59c04eb45231924 (diff)
parentc031e038df8429e14b0aa608aaa77068daa680f0 (diff)
downloadrneovim-c65d93e60adcacded822f0ad5d539042e600f523.tar.gz
rneovim-c65d93e60adcacded822f0ad5d539042e600f523.tar.bz2
rneovim-c65d93e60adcacded822f0ad5d539042e600f523.zip
Merge pull request #16969 from shadmansaleh/enhance/ingore_nore_on_plug_keymaps
feat: ignore nore on <Plug> maps
Diffstat (limited to 'runtime/lua/vim/keymap.lua')
-rw-r--r--runtime/lua/vim/keymap.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/keymap.lua b/runtime/lua/vim/keymap.lua
index d53b790746..df49eff4b6 100644
--- a/runtime/lua/vim/keymap.lua
+++ b/runtime/lua/vim/keymap.lua
@@ -42,7 +42,7 @@ local keymap = {}
--- |nvim_replace_termcodes()| is applied to the result of Lua expr maps.
--- - remap: (boolean) Make the mapping recursive. This is the
--- inverse of the "noremap" option from |nvim_set_keymap()|.
---- Default `true` if `lhs` is a string starting with `<plug>` (case-insensitive), `false` otherwise.
+--- Default `false`.
---@see |nvim_set_keymap()|
function keymap.set(mode, lhs, rhs, opts)
vim.validate {
@@ -66,8 +66,8 @@ function keymap.set(mode, lhs, rhs, opts)
opts.replace_keycodes = nil
if opts.remap == nil then
- -- remap by default on <plug> mappings and don't otherwise.
- opts.noremap = is_rhs_luaref or rhs:lower():match("^<plug>") == nil
+ -- default remap value is false
+ opts.noremap = true
else
-- remaps behavior is opposite of noremap option.
opts.noremap = not opts.remap