summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorSergio Mendez <[email protected]>2021-10-20 12:05:18 -0400
committerGitHub <[email protected]>2021-10-20 18:05:18 +0200
commit5cf8c07ee921f8dfed03415fe5b8322754ea8615 (patch)
tree001447e6f312499686d8fd5d13e5d48a3c6a7647 /init.lua
parent9be8ea6aab5f6f4618cdcdbeafd9eec6bc049d24 (diff)
fix(bootstrap): support for using default neovim config and data directories (#1777)
Co-authored-by: kylo252 <[email protected]> Co-authored-by: James Walmsley <[email protected]>
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 92a0b6e7..9bc5c9ee 100644
--- a/init.lua
+++ b/init.lua
@@ -1,9 +1,11 @@
-if os.getenv "LUNARVIM_RUNTIME_DIR" then
- local path_sep = vim.loop.os_uname().version:match "Windows" and "\\" or "/"
- vim.opt.rtp:append(os.getenv "LUNARVIM_RUNTIME_DIR" .. path_sep .. "lvim")
+local init_path = debug.getinfo(1, "S").source:sub(2)
+local base_dir = init_path:match("(.*[/\\])"):sub(1, -2)
+
+if not vim.tbl_contains(vim.opt.rtp:get(), base_dir) then
+ vim.opt.rtp:append(base_dir)
end
-require("lvim.bootstrap"):init()
+require("lvim.bootstrap"):init(base_dir)
require("lvim.config"):load()