Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
734 B

  1. local function open_nvim_tree(data)
  2. -- buffer is a real file on the disk
  3. local real_file = vim.fn.filereadable(data.file) == 1
  4. if not real_file then
  5. return
  6. end
  7. -- open the tree, find the file but don't focus it
  8. require("nvim-tree.api").tree.open({ focus = false, find_file = true, })
  9. end
  10. vim.api.nvim_create_autocmd({ "BufCreate" }, { callback = open_nvim_tree })
  11. return function ()
  12. require("nvim-tree").setup({
  13. sort_by = "case_sensitive",
  14. update_focused_file = {
  15. enable = true,
  16. update_cwd = true,
  17. },
  18. view = {
  19. adaptive_size = true,
  20. },
  21. diagnostics = {
  22. enable = true,
  23. show_on_dirs = true
  24. },
  25. renderer = {
  26. group_empty = false,
  27. },
  28. })
  29. end