aboutsummaryrefslogtreecommitdiff
path: root/plugin-settings
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2024-10-07 10:38:17 +0900
committerA Farzat <a@farzat.xyz>2024-10-14 15:25:48 +0900
commitabe2d72d03a9da751be3074109c76b5012787613 (patch)
tree6b5d7aae274716084989d6ed9d12206a53d44633 /plugin-settings
parentf611f1922a6c4bc19a661875391f09ccfd64a58d (diff)
downloadnvim-abe2d72d03a9da751be3074109c76b5012787613.tar.gz
nvim-abe2d72d03a9da751be3074109c76b5012787613.zip
Replace nerdtree with nvim-tree
Diffstat (limited to 'plugin-settings')
-rw-r--r--plugin-settings/nvim-tree.lua19
1 files changed, 19 insertions, 0 deletions
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', '<C-t>', 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,
+}