From 5cf8c07ee921f8dfed03415fe5b8322754ea8615 Mon Sep 17 00:00:00 2001 From: Sergio Mendez Date: Wed, 20 Oct 2021 12:05:18 -0400 Subject: fix(bootstrap): support for using default neovim config and data directories (#1777) Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: James Walmsley --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'init.lua') 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() -- cgit v1.2.3