summaryrefslogtreecommitdiff
path: root/lua/core/rooter.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-08-03 18:10:54 +0200
committerGitHub <[email protected]>2021-08-03 12:10:54 -0400
commit4c3c3f388557a182794bffdbf923129c66af885a (patch)
tree4138b428ccfbee42ffecdbc88bc7d2d42fa67195 /lua/core/rooter.lua
parentb608b08ff3a5f28e7c57bc7bd7a30cfe2ab5c111 (diff)
feat: add lvim.lsp.smart_cwd (#1218)
- Enable querying the language-server for the `root_dir` - Use `root_dir` to set the current working-directory (CWD) - Make vim-rooter configurable and add an option to disable it Inspired by "ahmedkhalf/lsp-rooter.nvim"
Diffstat (limited to 'lua/core/rooter.lua')
-rw-r--r--lua/core/rooter.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/core/rooter.lua b/lua/core/rooter.lua
new file mode 100644
index 00000000..8ebdf7cc
--- /dev/null
+++ b/lua/core/rooter.lua
@@ -0,0 +1,15 @@
+local M = {}
+function M.config()
+ lvim.builtin.rooter = {
+ --- This is on by default since it's currently the expected behavior.
+ ---@usage set to false to disable vim-rooter.
+ active = true,
+ silent_chdir = 1,
+ manual_only = 0,
+ }
+end
+function M.setup()
+ vim.g.rooter_silent_chdir = lvim.builtin.rooter.silent_chdir
+ vim.g.rooter_manual_only = lvim.builtin.rooter.manual_only
+end
+return M