From 24614101ba4574023ca901267a968b435380d8a0 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 4 Apr 2023 23:35:28 +0300 Subject: [PATCH] feat: use local variables for keybind opts --- modules/filetree/nvimtree-lua/config.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/filetree/nvimtree-lua/config.nix b/modules/filetree/nvimtree-lua/config.nix index a8cc9dc..6546232 100644 --- a/modules/filetree/nvimtree-lua/config.nix +++ b/modules/filetree/nvimtree-lua/config.nix @@ -18,10 +18,12 @@ in { # }; vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere '' - vim.api.nvim_set_keymap("n", "", ":NvimTreeToggle" ,{silent = true, noremap = true, nowait = true}) - vim.api.nvim_set_keymap("n", "tr", ":NvimTreeRefresh" ,{silent = true, noremap = true}) - vim.api.nvim_set_keymap("n", "tg", ":NvimTreeFindFile" ,{silent = true, noremap = true}) - vim.api.nvim_set_keymap("n", "tf", ":NvimTreeFocus" ,{silent = true, noremap = true}) + local opts = { silent = true, noremap = true } + + vim.api.nvim_set_keymap("n", "", ":NvimTreeToggle", opts) + vim.api.nvim_set_keymap("n", "tr", ":NvimTreeRefresh", opts) + vim.api.nvim_set_keymap("n", "tg", ":NvimTreeFindFile", opts) + vim.api.nvim_set_keymap("n", "tf", ":NvimTreeFocus", opts) local function open_nvim_tree(data) local IGNORED_FT = {