init.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --[[ "
  2. --let g:nvim_tree_auto_ignore_ft = 'startify' "empty by default, don't auto open tree on specific filetypes.
  3. let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.`
  4. let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons).
  5. " let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open
  6. " let g:nvim_tree_width_allow_resize = 1 "0 by default, will not resize the tree when opening a file
  7. let g:nvim_tree_show_icons = {
  8. \ 'git': 1,
  9. \ 'folders': 1,
  10. \ 'files': 1,
  11. \ }
  12. "If 0, do not show the icons for one of 'git' 'folder' and 'files'
  13. "1 by default, notice that if 'files' is 1, it will only display
  14. "if nvim-web-devicons is installed and on your runtimepath ]] -- vim.g.nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
  15. -- vim.g.nvim_tree_disable_netrw = 0 -- moved to lv-globals
  16. -- vim.g.nvim_tree_hijack_netrw = 0 --"1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities)
  17. vim.g.nvim_tree_hide_dotfiles = 1 -- 0 by default, this option hides files and folders starting with a dot `.`
  18. vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
  19. vim.g.nvim_tree_follow = 1 -- "0 by default, this option allows the cursor to be updated when entering a buffer
  20. vim.g.nvim_tree_auto_close = O.auto_close_tree -- 0 by default, closes the tree when it's the last window
  21. vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
  22. local tree_cb = require'nvim-tree.config'.nvim_tree_callback
  23. vim.g.nvim_tree_bindings = {
  24. -- ["<CR>"] = ":YourVimFunction()<cr>",
  25. -- ["u"] = ":lua require'some_module'.some_function()<cr>",
  26. -- default mappings
  27. ["<CR>"] = tree_cb("edit"),
  28. ["o"] = tree_cb("edit"),
  29. ["l"] = tree_cb("edit"),
  30. ["<2-LeftMouse>"] = tree_cb("edit"),
  31. ["<2-RightMouse>"] = tree_cb("cd"),
  32. ["<C-]>"] = tree_cb("cd"),
  33. ["v"] = tree_cb("vsplit"),
  34. ["s"] = tree_cb("split"),
  35. ["<C-t>"] = tree_cb("tabnew"),
  36. ["<"] = tree_cb("prev_sibling"),
  37. [">"] = tree_cb("next_sibling"),
  38. ["<BS>"] = tree_cb("close_node"),
  39. ["h"] = tree_cb("close_node"),
  40. ["<S-CR>"] = tree_cb("close_node"),
  41. ["<Tab>"] = tree_cb("preview"),
  42. ["I"] = tree_cb("toggle_ignored"),
  43. ["H"] = tree_cb("toggle_dotfiles"),
  44. ["R"] = tree_cb("refresh"),
  45. ["a"] = tree_cb("create"),
  46. ["d"] = tree_cb("remove"),
  47. ["r"] = tree_cb("rename"),
  48. ["<C-r>"] = tree_cb("full_rename"),
  49. ["x"] = tree_cb("cut"),
  50. ["c"] = tree_cb("copy"),
  51. ["p"] = tree_cb("paste"),
  52. ["[c"] = tree_cb("prev_git_item"),
  53. ["]c"] = tree_cb("next_git_item"),
  54. ["-"] = tree_cb("dir_up"),
  55. ["q"] = tree_cb("close"),
  56. }
  57. -- vim.g.nvim_tree_show_icons = {git = 1, folders = 1, files = 1}
  58. vim.g.nvim_tree_icons = {
  59. default = '',
  60. symlink = '',
  61. git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
  62. folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
  63. }