project.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. local M = {}
  2. --
  3. function M.config()
  4. lvim.builtin.project = {
  5. --- This is on by default since it's currently the expected behavior.
  6. ---@usage set to false to disable project.nvim.
  7. active = true,
  8. -- Manual mode doesn't automatically change your root directory, so you have
  9. -- the option to manually do so using `:ProjectRoot` command.
  10. manual_mode = false,
  11. -- Methods of detecting the root directory. **"lsp"** uses the native neovim
  12. -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here
  13. -- order matters: if one is not detected, the other is used as fallback. You
  14. -- can also delete or rearangne the detection methods.
  15. detection_methods = { "lsp", "pattern" },
  16. -- All the patterns used to detect root dir, when **"pattern"** is in
  17. -- detection_methods
  18. patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
  19. -- Show hidden files in telescope
  20. show_hidden = false,
  21. -- When set to false, you will get a message when project.nvim changes your
  22. -- directory.
  23. silent_chdir = true,
  24. }
  25. end
  26. --
  27. function M.setup()
  28. local settings = lvim.builtin.project
  29. -- Table of lsp clients to ignore by name
  30. -- eg: { "efm", ... }
  31. settings["ignore_lsp"] = {}
  32. -- Path where project.nvim will store the project history for use in
  33. -- telescope
  34. settings["datapath"] = CACHE_PATH
  35. require("project_nvim").setup(settings)
  36. lvim.builtin.dashboard.custom_section["b"] = {
  37. description = { " Recent Projects " },
  38. command = "Telescope projects",
  39. }
  40. end
  41. --
  42. return M