summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua24
1 files changed, 22 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 92ec3d4b..a69fde44 100644
--- a/init.lua
+++ b/init.lua
@@ -11,12 +11,32 @@ vim.cmd [[
set runtimepath^=~/.local/share/lunarvim/lvim/after
]]
-- vim.opt.rtp:append() instead of vim.cmd ?
+
+local function file_exists(name)
+ local f = io.open(name, "r")
+ if f ~= nil then
+ io.close(f)
+ return true
+ else
+ return false
+ end
+end
+
+local lvim_path = os.getenv "HOME" .. "/.config/lvim/"
+USER_CONFIG_PATH = lvim_path .. "config.lua"
+local config_exist = file_exists(USER_CONFIG_PATH)
+if not config_exist then
+ USER_CONFIG_PATH = lvim_path .. "lv-config.lua"
+ print "Rename ~/.config/lvim/lv-config.lua to config.lua"
+end
+
require "default-config"
local autocmds = require "core.autocmds"
require("settings").load_options()
-local status_ok, error = pcall(vim.cmd, "luafile ~/.config/lvim/lv-config.lua")
+
+local status_ok, error = pcall(vim.cmd, "luafile " .. USER_CONFIG_PATH)
if not status_ok then
- print "something is wrong with your lv-config"
+ print("something is wrong with your " .. USER_CONFIG_PATH)
print(error)
end
require("settings").load_commands()