feat(root): allow custom functions as part of vim.g.root_spec

This commit is contained in:
Folke Lemaitre 2023-10-11 09:38:34 +02:00
parent 27ceb433a9
commit b5495eb38a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 23 additions and 3 deletions

View file

@ -6,7 +6,10 @@ vim.g.maplocalleader = "\\"
vim.g.autoformat = true
-- LazyVim root dir detection
-- Each entry can be a detector function like `lsp` or `cwd`, or a pattern like `.git` or `lua`.
-- Each entry can be:
-- * the name of a detector function like `lsp` or `cwd`
-- * a pattern or array of patterns like `.git` or `lua`.
-- * a function with signature `function(buf) -> string|string[]`
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
local opt = vim.opt