project.lua 1.8 KB

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