feat: always perform the mappings
I have found no use of not performing a mapping and the user can always remap after calling setup.
This commit is contained in:
parent
d7dc868fe4
commit
484015a0b5
@ -4,4 +4,4 @@
|
||||
|
||||
Remap for the bepo layout in Lua, inspired from https://github.com/michamos/vim-bepo
|
||||
|
||||
It aims to be faster (takes only 0.6ms at startup on my machine, while vim-bepo requires 1.6ms)
|
||||
It aims to be faster (takes only 0.4ms at startup on my machine, while vim-bepo requires 1.6ms)
|
||||
|
@ -17,16 +17,14 @@
|
||||
|
||||
(fn map-text-object [key target]
|
||||
"For text-objects mappings"
|
||||
(if (= (vim.fn.maparg key :o) "")
|
||||
(vim.api.nvim_set_keymap :o key target {:noremap true})
|
||||
(= (vim.fn.maparg key :x) "")
|
||||
(vim.api.nvim_set_keymap :x key target {:noremap true}))
|
||||
(vim.api.nvim_set_keymap :x key target {:noremap true})
|
||||
nil)
|
||||
|
||||
(fn map-normal [key target]
|
||||
"For normal mode mappings"
|
||||
(when (= (vim.fn.maparg key :n) "")
|
||||
(vim.api.nvim_set_keymap :n key target {:noremap true})))
|
||||
(vim.api.nvim_set_keymap :n key target {:noremap true})
|
||||
nil)
|
||||
|
||||
(fn map-all [key target]
|
||||
"For all directional mappings"
|
||||
|
@ -1,18 +1,11 @@
|
||||
local function map_text_object(key, target)
|
||||
if (vim.fn.maparg(key, "o") == "") then
|
||||
vim.api.nvim_set_keymap("o", key, target, {noremap = true})
|
||||
elseif (vim.fn.maparg(key, "x") == "") then
|
||||
vim.api.nvim_set_keymap("x", key, target, {noremap = true})
|
||||
else
|
||||
end
|
||||
return nil
|
||||
end
|
||||
local function map_normal(key, target)
|
||||
if (vim.fn.maparg(key, "n") == "") then
|
||||
return vim.api.nvim_set_keymap("n", key, target, {noremap = true})
|
||||
else
|
||||
vim.api.nvim_set_keymap("n", key, target, {noremap = true})
|
||||
return nil
|
||||
end
|
||||
end
|
||||
local function map_all(key, target)
|
||||
map_normal(key, target)
|
||||
|
Loading…
x
Reference in New Issue
Block a user