project.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. -- When set to false, you will get a message when project.nvim changes your
  20. -- directory.
  21. silent_chdir = true,
  22. }
  23. end
  24. --
  25. function M.setup()
  26. local settings = lvim.builtin.project
  27. -- Table of lsp clients to ignore by name
  28. -- eg: { "efm", ... }
  29. settings["ignore_lsp"] = {}
  30. -- Path where project.nvim will store the project history for use in
  31. -- telescope
  32. settings["datapath"] = CACHE_PATH
  33. require("project_nvim").setup(settings)
  34. lvim.builtin.dashboard.custom_section["b"] = {
  35. description = { " Recent Projects " },
  36. command = "Telescope projects",
  37. }
  38. end
  39. --
  40. return M