update nvimTree configs && highlights

This commit is contained in:
siduck76 2021-06-02 00:15:55 +05:30
parent 859a557297
commit 9233adfd5f
2 changed files with 42 additions and 33 deletions

View file

@ -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"

View file

@ -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')<CR>", 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 = {
["<CR>"] = get_lua_cb("edit"),
["o"] = get_lua_cb("edit"),
["<2-LeftMouse>"] = get_lua_cb("edit"),
["<2-RightMouse>"] = get_lua_cb("cd"),
["<C-]>"] = get_lua_cb("cd"),
["<C-v>"] = get_lua_cb("vsplit"),
["<C-x>"] = get_lua_cb("split"),
["<C-t>"] = get_lua_cb("tabnew"),
["<BS>"] = get_lua_cb("close_node"),
["<S-CR>"] = get_lua_cb("close_node"),
["<Tab>"] = 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"),
["<C-r>"] = 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()<cr>",
-- default mappings
["<CR>"] = tree_cb("edit"),
["o"] = tree_cb("edit"),
["<2-LeftMouse>"] = tree_cb("edit"),
["<2-RightMouse>"] = tree_cb("cd"),
["<C-]>"] = tree_cb("cd"),
["<C-v>"] = tree_cb("vsplit"),
["<C-x>"] = tree_cb("split"),
["<C-t>"] = tree_cb("tabnew"),
["<"] = tree_cb("prev_sibling"),
[">"] = tree_cb("next_sibling"),
["<BS>"] = tree_cb("close_node"),
["<S-CR>"] = tree_cb("close_node"),
["<Tab>"] = 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"),
["<C-r>"] = 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")
}