From d4fa88bd63378631eb5633b491fee11852c2817c Mon Sep 17 00:00:00 2001 From: diniamo Date: Mon, 8 Jul 2024 15:40:37 +0200 Subject: [PATCH 1/2] fix setup_keymaps --- lua/direnv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/direnv.lua b/lua/direnv.lua index 670e82a..22728f4 100644 --- a/lua/direnv.lua +++ b/lua/direnv.lua @@ -15,7 +15,7 @@ local function setup_keymaps(keymaps, mode, opts) for _, map in ipairs(keymaps) do local options = vim.tbl_extend("force", { noremap = true, silent = true }, opts or {}) - vim.api.nvim_set_keymap(mode, map[1], map[2], options) + vim.keymap.set(mode, map[1], map[2], options) end end From 8b702a5d35aec55e168197c04a26a156393d7268 Mon Sep 17 00:00:00 2001 From: diniamo Date: Mon, 8 Jul 2024 15:46:59 +0200 Subject: [PATCH 2/2] fix keymap descriptions --- lua/direnv.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lua/direnv.lua b/lua/direnv.lua index 22728f4..7a82469 100644 --- a/lua/direnv.lua +++ b/lua/direnv.lua @@ -11,10 +11,13 @@ local function check_executable(executable_name) return true end -local function setup_keymaps(keymaps, mode, opts) +local function setup_keymaps(keymaps, mode) for _, map in ipairs(keymaps) do - local options = - vim.tbl_extend("force", { noremap = true, silent = true }, opts or {}) + local options = vim.tbl_extend( + "force", + { noremap = true, silent = true }, + map[3] or {} + ) vim.keymap.set(mode, map[1], map[2], options) end end @@ -57,21 +60,21 @@ M.setup = function(user_config) function() M.allow_direnv() end, - desc = "Allow direnv", + { desc = "Allow direnv" }, }, { config.keybindings.deny, function() M.deny_direnv() end, - desc = "Deny direnv", + { desc = "Deny direnv" }, }, { config.keybindings.reload, function() M.check_direnv() end, - desc = "Reload direnv", + { desc = "Reload direnv" }, }, }, "n")