diff --git a/lua/plugins/editor_mine.lua b/lua/plugins/editor_mine.lua index e3ff1e6..52b11e3 100644 --- a/lua/plugins/editor_mine.lua +++ b/lua/plugins/editor_mine.lua @@ -42,8 +42,19 @@ return { end end end, - config = function() - require("nvim-tree").setup() + opts = { + -- https://github.com/nvim-tree/nvim-tree.lua?tab=readme-ov-file#custom-mappings + on_attach = function(bufnr) + local api = require("nvim-tree.api") + local function opts(desc) + return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end + api.config.mappings.default_on_attach(bufnr) + vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help")) + end, + }, + config = function(_, opts) + require("nvim-tree").setup(opts) end, }, }