summaryrefslogtreecommitdiff
path: root/lua/core/project.lua
blob: 650f2924396aa3813073cb2b1e7ac3531ab69265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
local M = {}
--
function M.config()
  lvim.builtin.project = {
    --- This is on by default since it's currently the expected behavior.
    ---@usage set to false to disable project.nvim.
    active = true,

    -- Manual mode doesn't automatically change your root directory, so you have
    -- the option to manually do so using `:ProjectRoot` command.
    manual_mode = false,

    -- Methods of detecting the root directory. **"lsp"** uses the native neovim
    -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here
    -- order matters: if one is not detected, the other is used as fallback. You
    -- can also delete or rearangne the detection methods.
    detection_methods = { "lsp", "pattern" },

    -- All the patterns used to detect root dir, when **"pattern"** is in
    -- detection_methods
    patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },

    -- When set to false, you will get a message when project.nvim changes your
    -- directory.
    silent_chdir = true,
  }
end
--
function M.setup()
  local settings = lvim.builtin.project

  -- Table of lsp clients to ignore by name
  -- eg: { "efm", ... }
  settings["ignore_lsp"] = {}

  -- Path where project.nvim will store the project history for use in
  -- telescope
  settings["datapath"] = CACHE_PATH

  require("project_nvim").setup(settings)

  lvim.builtin.dashboard.custom_section["b"] = {
    description = { "  Recent Projects    " },
    command = "Telescope projects",
  }
end
--
return M