mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2024-11-30 03:16:44 +00:00
Merge pull request #4 from diniamo/main
fix setup_keymaps, fix keymap descriptions
This commit is contained in:
commit
3e38d855c7
1 changed files with 10 additions and 7 deletions
|
@ -11,11 +11,14 @@ local function check_executable(executable_name)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setup_keymaps(keymaps, mode, opts)
|
local function setup_keymaps(keymaps, mode)
|
||||||
for _, map in ipairs(keymaps) do
|
for _, map in ipairs(keymaps) do
|
||||||
local options =
|
local options = vim.tbl_extend(
|
||||||
vim.tbl_extend("force", { noremap = true, silent = true }, opts or {})
|
"force",
|
||||||
vim.api.nvim_set_keymap(mode, map[1], map[2], options)
|
{ noremap = true, silent = true },
|
||||||
|
map[3] or {}
|
||||||
|
)
|
||||||
|
vim.keymap.set(mode, map[1], map[2], options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,21 +60,21 @@ M.setup = function(user_config)
|
||||||
function()
|
function()
|
||||||
M.allow_direnv()
|
M.allow_direnv()
|
||||||
end,
|
end,
|
||||||
desc = "Allow direnv",
|
{ desc = "Allow direnv" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
config.keybindings.deny,
|
config.keybindings.deny,
|
||||||
function()
|
function()
|
||||||
M.deny_direnv()
|
M.deny_direnv()
|
||||||
end,
|
end,
|
||||||
desc = "Deny direnv",
|
{ desc = "Deny direnv" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
config.keybindings.reload,
|
config.keybindings.reload,
|
||||||
function()
|
function()
|
||||||
M.check_direnv()
|
M.check_direnv()
|
||||||
end,
|
end,
|
||||||
desc = "Reload direnv",
|
{ desc = "Reload direnv" },
|
||||||
},
|
},
|
||||||
}, "n")
|
}, "n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue