summaryrefslogtreecommitdiff
path: root/.config/nvim/plugin-settings/nvim-tree.lua
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2024-11-06 09:09:37 +0900
committerA Farzat <a@farzat.xyz>2024-11-13 09:13:20 +0900
commit7ec1fa7385c1b88a2efdad72c805b254c52084bd (patch)
tree2917de2bbd3552adca5dbe4989460f4b25672595 /.config/nvim/plugin-settings/nvim-tree.lua
parentcb5affa0e11c200f175e26ced4f2866aa916d2c9 (diff)
downloaddotfiles-7ec1fa7385c1b88a2efdad72c805b254c52084bd.tar.gz
dotfiles-7ec1fa7385c1b88a2efdad72c805b254c52084bd.zip
Remove nvim submodule
Nvim config will be included as bare files instead of a submodule. The nvim config repo will still exist, but the content will be used by yadm without the repo itself.
Diffstat (limited to '.config/nvim/plugin-settings/nvim-tree.lua')
-rw-r--r--.config/nvim/plugin-settings/nvim-tree.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/.config/nvim/plugin-settings/nvim-tree.lua b/.config/nvim/plugin-settings/nvim-tree.lua
new file mode 100644
index 0000000..a8dcd46
--- /dev/null
+++ b/.config/nvim/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,
+}