2021-07-17 07:14:52 -04:00
local present , tree_c = pcall ( require , " nvim-tree.config " )
2021-09-24 09:42:44 -04:00
local git_status = require ( " core.utils " ) . load_config ( ) . plugins.options . nvimtree.enable_git
2021-09-24 09:37:24 -04:00
2021-07-17 07:14:52 -04:00
if not present then
2021-08-16 03:49:09 -04:00
return
2021-07-15 11:43:17 -04:00
end
2021-04-02 01:36:20 -04:00
2021-07-17 07:14:52 -04:00
local tree_cb = tree_c.nvim_tree_callback
2021-07-15 11:43:17 -04:00
local g = vim.g
2021-03-07 09:22:30 -05:00
2021-07-15 11:43:17 -04:00
vim.o . termguicolors = true
2021-03-07 09:22:30 -05:00
2021-08-22 03:49:15 -04:00
g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names
g.nvim_tree_allow_resize = 1
2021-09-24 09:37:24 -04:00
g.nvim_tree_git_hl = git_status
g.nvim_tree_gitignore = git_status
2021-08-23 08:20:24 -04:00
g.nvim_tree_hide_dotfiles = 0
2021-07-15 11:43:17 -04:00
g.nvim_tree_highlight_opened_files = 0
2021-08-22 03:49:15 -04:00
g.nvim_tree_indent_markers = 1
g.nvim_tree_ignore = { " .git " , " node_modules " , " .cache " }
g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened
2021-08-16 03:49:09 -04:00
g.nvim_tree_root_folder_modifier = table.concat { " :t:gs?$?/.. " , string.rep ( " " , 1000 ) , " ?:gs?^?? " }
2021-08-22 03:49:15 -04:00
g.nvim_tree_side = " left "
g.nvim_tree_width = 25
2021-06-01 14:45:55 -04:00
2021-07-15 11:43:17 -04:00
g.nvim_tree_show_icons = {
2021-08-16 03:49:09 -04:00
folders = 1 ,
-- folder_arrows= 1
2021-08-22 03:49:15 -04:00
files = 1 ,
2021-09-24 09:37:24 -04:00
git = git_status ,
2021-07-15 11:43:17 -04:00
}
2021-08-22 03:49:15 -04:00
2021-07-15 11:43:17 -04:00
g.nvim_tree_icons = {
2021-08-16 03:49:09 -04:00
default = " " ,
symlink = " " ,
git = {
2021-08-22 03:49:15 -04:00
deleted = " " ,
ignored = " ◌ " ,
renamed = " ➜ " ,
2021-08-16 03:49:09 -04:00
staged = " ✓ " ,
unmerged = " " ,
2021-08-22 03:49:15 -04:00
unstaged = " ✗ " ,
2021-08-16 03:49:09 -04:00
untracked = " ★ " ,
} ,
folder = {
-- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below!
-- arrow_open = "",
-- arrow_closed = "",
default = " " ,
empty = " " , --
empty_open = " " ,
2021-08-22 03:49:15 -04:00
open = " " ,
2021-08-16 03:49:09 -04:00
symlink = " " ,
symlink_open = " " ,
} ,
2021-07-15 11:43:17 -04:00
}
2021-06-25 13:36:17 -04:00
2021-07-15 11:43:17 -04:00
g.nvim_tree_bindings = {
2021-08-16 03:49:09 -04:00
{ key = { " <CR> " , " o " , " <2-LeftMouse> " } , cb = tree_cb " edit " } ,
{ key = { " <2-RightMouse> " , " <C-]> " } , cb = tree_cb " cd " } ,
{ key = " <C-v> " , cb = tree_cb " vsplit " } ,
{ key = " <C-x> " , cb = tree_cb " split " } ,
{ key = " <C-t> " , cb = tree_cb " tabnew " } ,
{ key = " < " , cb = tree_cb " prev_sibling " } ,
{ key = " > " , cb = tree_cb " next_sibling " } ,
{ key = " P " , cb = tree_cb " parent_node " } ,
{ key = " <BS> " , cb = tree_cb " close_node " } ,
{ key = " <S-CR> " , cb = tree_cb " close_node " } ,
{ key = " <Tab> " , cb = tree_cb " preview " } ,
{ key = " K " , cb = tree_cb " first_sibling " } ,
{ key = " J " , cb = tree_cb " last_sibling " } ,
{ key = " I " , cb = tree_cb " toggle_ignored " } ,
{ key = " H " , cb = tree_cb " toggle_dotfiles " } ,
{ key = " R " , cb = tree_cb " refresh " } ,
{ key = " a " , cb = tree_cb " create " } ,
{ key = " d " , cb = tree_cb " remove " } ,
{ key = " r " , cb = tree_cb " rename " } ,
{ key = " <C-> " , cb = tree_cb " full_rename " } ,
{ key = " x " , cb = tree_cb " cut " } ,
{ key = " c " , cb = tree_cb " copy " } ,
{ key = " p " , cb = tree_cb " paste " } ,
{ key = " y " , cb = tree_cb " copy_name " } ,
{ key = " Y " , cb = tree_cb " copy_path " } ,
{ key = " gy " , cb = tree_cb " copy_absolute_path " } ,
{ key = " [c " , cb = tree_cb " prev_git_item " } ,
{ key = " }c " , cb = tree_cb " next_git_item " } ,
{ key = " - " , cb = tree_cb " dir_up " } ,
{ key = " q " , cb = tree_cb " close " } ,
{ key = " g? " , cb = tree_cb " toggle_help " } ,
2021-07-15 11:43:17 -04:00
}
2021-09-25 12:41:27 -04:00
require ( " nvim-tree " ) . setup {
2021-09-26 06:10:12 -04:00
lsp_diagnostics = false ,
2021-09-25 12:41:27 -04:00
disable_netrw = true ,
hijack_netrw = true ,
ignore_ft_on_setup = { " dashboard " } ,
auto_close = false ,
open_on_tab = false ,
hijack_cursor = true ,
update_cwd = true ,
update_focused_file = {
enable = true ,
update_cwd = true ,
} ,
}