init.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 ]]
  15. -- vim.g.nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
  16. vim.g.nvim_tree_disable_netrw = 0 --"1 by default, disables netrw
  17. -- 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)
  18. vim.g.nvim_tree_hide_dotfiles = 1 --0 by default, this option hides files and folders starting with a dot `.`
  19. vim.g.nvim_tree_indent_markers = 1 --"0 by default, this option shows indent markers when folders are open
  20. vim.g.nvim_tree_follow = 1 --"0 by default, this option allows the cursor to be updated when entering a buffer
  21. vim.g.nvim_tree_auto_close = 0 --0 by default, closes the tree when it's the last window
  22. vim.g.nvim_tree_auto_ignore_ft = 'startify' --"empty by default, don't auto open tree on specific filetypes.
  23. local tree_cb = require'nvim-tree.config'.nvim_tree_callback
  24. vim.g.nvim_tree_bindings = {
  25. -- mappings
  26. ["<CR>"] = tree_cb("edit"),
  27. ["l"] = tree_cb("edit"),
  28. ["o"] = tree_cb("edit"),
  29. ["<2-LeftMouse>"] = tree_cb("edit"),
  30. ["<2-RightMouse>"] = tree_cb("cd"),
  31. ["<C-]>"] = tree_cb("cd"),
  32. ["v"] = tree_cb("vsplit"),
  33. ["s"] = tree_cb("split"),
  34. ["<C-t>"] = tree_cb("tabnew"),
  35. ["h"] = tree_cb("close_node"),
  36. ["<BS>"] = tree_cb("close_node"),
  37. ["<S-CR>"] = tree_cb("close_node"),
  38. ["<Tab>"] = tree_cb("preview"),
  39. ["I"] = tree_cb("toggle_ignored"),
  40. ["H"] = tree_cb("toggle_dotfiles"),
  41. ["R"] = tree_cb("refresh"),
  42. ["a"] = tree_cb("create"),
  43. ["d"] = tree_cb("remove"),
  44. ["r"] = tree_cb("rename"),
  45. ["<C-r>"] = tree_cb("full_rename"),
  46. ["x"] = tree_cb("cut"),
  47. ["c"] = tree_cb("copy"),
  48. ["p"] = tree_cb("paste"),
  49. ["[c"] = tree_cb("prev_git_item"),
  50. ["]c"] = tree_cb("next_git_item"),
  51. ["-"] = tree_cb("dir_up"),
  52. ["q"] = tree_cb("close")
  53. }
  54. vim.g.nvim_tree_icons = {
  55. default = '',
  56. symlink = '',
  57. git = {
  58. unstaged = "",
  59. staged = "✓",
  60. unmerged = "",
  61. renamed = "➜",
  62. untracked = ""
  63. },
  64. folder = {
  65. default = "",
  66. open = "",
  67. empty = "",
  68. empty_open = "",
  69. symlink = ""
  70. }
  71. }