From abe2d72d03a9da751be3074109c76b5012787613 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Mon, 7 Oct 2024 10:38:17 +0900 Subject: Replace nerdtree with nvim-tree --- plugin-settings/nvim-tree.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugin-settings/nvim-tree.lua (limited to 'plugin-settings/nvim-tree.lua') diff --git a/plugin-settings/nvim-tree.lua b/plugin-settings/nvim-tree.lua new file mode 100644 index 0000000..a8dcd46 --- /dev/null +++ b/plugin-settings/nvim-tree.lua @@ -0,0 +1,19 @@ +local function my_on_attach(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 + + -- default mappings + api.config.mappings.default_on_attach(bufnr) + + -- custom mappings + vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) + vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) +end + +-- pass to setup along with your other options +require("nvim-tree").setup { + on_attach = my_on_attach, +} -- cgit v1.2.3-70-g09d2