From 7ec1fa7385c1b88a2efdad72c805b254c52084bd Mon Sep 17 00:00:00 2001 From: A Farzat Date: Wed, 6 Nov 2024 09:09:37 +0900 Subject: 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. --- .config/nvim/plugin-settings/nvim-tree.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/nvim/plugin-settings/nvim-tree.lua (limited to '.config/nvim/plugin-settings/nvim-tree.lua') 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', '', 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