project.lua 515 B

123456789101112131415161718192021
  1. local status, project = pcall(require, "project_nvim")
  2. if not status then
  3. vim.notify("没有找到 project_nvim")
  4. return
  5. end
  6. -- nvim-tree 支持
  7. vim.g.nvim_tree_respect_buf_cwd = 1
  8. project.setup({
  9. detection_methods = {"pattern"},
  10. patterns = {".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", ".sln"}
  11. })
  12. local status, telescope = pcall(require, "telescope")
  13. if not status then
  14. vim.notify("没有找到 telescope")
  15. return
  16. end
  17. pcall(telescope.load_extension, "projects")