summaryrefslogtreecommitdiff
path: root/.config/nvim/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.lua')
-rw-r--r--.config/nvim/init.lua33
1 files changed, 7 insertions, 26 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 7c96238..ff6c632 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1,31 +1,12 @@
-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
+-- TODO: we need something like this: vim.opt.packpath = vim.opt.rtp
+vim.cmd [[let &packpath = &runtimepath]]
+-- }}}
-local nvim_path = os.getenv "HOME" .. "/.config/nvim/"
-USER_CONFIG_PATH = nvim_path .. "config.lua"
-local config_exist = file_exists(USER_CONFIG_PATH)
-if not config_exist then
- USER_CONFIG_PATH = nvim_path .. "config.lua"
- print "Rename ~/.config/nvim/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(options.autocommands)
local plugins = require "plugins"
@@ -44,7 +25,7 @@ require("lsp").config()
local null_status_ok, null_ls = pcall(require, "null-ls")
if null_status_ok then
null_ls.config {}
- require("lspconfig")["null-ls"].setup {}
+ require("lspconfig")["null-ls"].setup(options.lsp.null_ls.setup)
end
local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings")