diff options
author | Luc Sinet <[email protected]> | 2021-08-25 07:47:48 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-25 07:47:48 +0200 |
commit | 00b895d9e9577f084cf577a07f9d6d6e1f7a4cac (patch) | |
tree | 1139617d5b3acd56f221f24ce301f51535267bdc /init.lua | |
parent | f6c706ac0c346491cc79bdea46a52ee7a8694e0d (diff) |
[Feature] Encapsulate config logic (#1338)
* Define core/builtins, streamline status_color interface
* Encapsulate configuration in its own module
* Add fallback to lv-config.lua
* Rectify settings loading order to allow overriding vim options
* Move default-config into config/ module
* replace uv.fs_stat with utils.is_file
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 29 |
1 files changed, 3 insertions, 26 deletions
@@ -17,34 +17,11 @@ vim.opt.rtp:append(home_dir .. "/.local/share/lunarvim/site/after") vim.cmd [[let &packpath = &runtimepath]] -- }}} -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 +local config = require "config" +config:init() +config:load() -require "default-config" local autocmds = require "core.autocmds" -require("settings").load_options() - -local status_ok, error = pcall(vim.cmd, "luafile " .. USER_CONFIG_PATH) -if not status_ok then - print("something is wrong with your " .. USER_CONFIG_PATH) - print(error) -end -require("settings").load_commands() autocmds.define_augroups(lvim.autocommands) local plugins = require "plugins" |