diff --git a/lua/custom_highlights.lua b/lua/custom_highlights.lua index 05b4230..9ac807e 100644 --- a/lua/custom_highlights.lua +++ b/lua/custom_highlights.lua @@ -34,7 +34,7 @@ cmd "hi NvimTreeFolderName guifg = #61afef" cmd "hi NvimTreeIndentMarker guifg=#383c44" cmd "hi NvimTreeNormal guibg=#1b1f27" cmd "hi NvimTreeVertSplit guifg=#1e222a" -cmd "hi NvimTreeRootFolder guifg=#f9929b" +cmd "hi NvimTreeRootFolder guifg=#1b1f27" -- telescope cmd "hi TelescopeBorder guifg=#2a2e36" diff --git a/lua/nvimTree.lua b/lua/nvimTree.lua index 137b986..591ec8a 100644 --- a/lua/nvimTree.lua +++ b/lua/nvimTree.lua @@ -30,19 +30,19 @@ g.nvim_tree_icons = { staged = "✓", unmerged = "", renamed = "➜", - untracked = "★" + untracked = "★", + deleted = "", + ignored = "◌" }, folder = { default = "", open = "", - symlink = "" + symlink = "", + empty = "", + empty_open = "", + symlink_open = "" } } - -local get_lua_cb = function(cb_name) - return string.format(":lua require'nvim-tree'.on_keypress('%s')", cb_name) -end - -- Mappings for nvimtree vim.api.nvim_set_keymap( @@ -55,30 +55,39 @@ vim.api.nvim_set_keymap( } ) +local tree_cb = require "nvim-tree.config".nvim_tree_callback + g.nvim_tree_bindings = { - [""] = get_lua_cb("edit"), - ["o"] = get_lua_cb("edit"), - ["<2-LeftMouse>"] = get_lua_cb("edit"), - ["<2-RightMouse>"] = get_lua_cb("cd"), - [""] = get_lua_cb("cd"), - [""] = get_lua_cb("vsplit"), - [""] = get_lua_cb("split"), - [""] = get_lua_cb("tabnew"), - [""] = get_lua_cb("close_node"), - [""] = get_lua_cb("close_node"), - [""] = get_lua_cb("preview"), - ["I"] = get_lua_cb("toggle_ignored"), - ["H"] = get_lua_cb("toggle_dotfiles"), - ["R"] = get_lua_cb("refresh"), - ["a"] = get_lua_cb("create"), - ["d"] = get_lua_cb("remove"), - ["r"] = get_lua_cb("rename"), - [""] = get_lua_cb("full_rename"), - ["x"] = get_lua_cb("cut"), - ["c"] = get_lua_cb("copy"), - ["p"] = get_lua_cb("paste"), - ["[c"] = get_lua_cb("prev_git_item"), - ["]c"] = get_lua_cb("next_git_item"), - ["-"] = get_lua_cb("dir_up"), - ["q"] = get_lua_cb("close") + ["u"] = ":lua require'some_module'.some_function()", + -- default mappings + [""] = tree_cb("edit"), + ["o"] = tree_cb("edit"), + ["<2-LeftMouse>"] = tree_cb("edit"), + ["<2-RightMouse>"] = tree_cb("cd"), + [""] = tree_cb("cd"), + [""] = tree_cb("vsplit"), + [""] = tree_cb("split"), + [""] = tree_cb("tabnew"), + ["<"] = tree_cb("prev_sibling"), + [">"] = tree_cb("next_sibling"), + [""] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("preview"), + ["I"] = tree_cb("toggle_ignored"), + ["H"] = tree_cb("toggle_dotfiles"), + ["R"] = tree_cb("refresh"), + ["a"] = tree_cb("create"), + ["d"] = tree_cb("remove"), + ["r"] = tree_cb("rename"), + [""] = tree_cb("full_rename"), + ["x"] = tree_cb("cut"), + ["c"] = tree_cb("copy"), + ["p"] = tree_cb("paste"), + ["y"] = tree_cb("copy_name"), + ["Y"] = tree_cb("copy_path"), + ["gy"] = tree_cb("copy_absolute_path"), + ["[c"] = tree_cb("prev_git_item"), + ["]c"] = tree_cb("next_git_item"), + ["-"] = tree_cb("dir_up"), + ["q"] = tree_cb("close") }