nvim: Refactor core setting loading into core module

Move everything pertinent from init.lua to the core module init file
itself. For now the only thing remaining in the init lua is requiring
the core.
This commit is contained in:
Marty Oehme 2023-12-12 14:07:43 +01:00
parent 78987c493e
commit c27e697870
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
2 changed files with 13 additions and 21 deletions

View File

@ -1,21 +1 @@
-- many ideas for this config come from
-- https://github.com/elianiva/dotfiles/ - with much gratitude
local api = vim.api
api.nvim_exec2("runtime abbrev.vim", {})
for _, source in ipairs({
"core.settings",
"core.lazy",
"core.autocmds",
"core.mappings",
"core.look",
}) do
local status_ok, fault = pcall(require, source)
if not status_ok then
vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault)
end
end
-- to include e.g. the spell dictionaries for vim
vim.opt.rtp:append(vim.fn.stdpath("data") .. "/site")
require("core")

View File

@ -0,0 +1,12 @@
for _, source in ipairs({
"core.settings",
"core.lazy",
"core.autocmds",
"core.mappings",
"core.look",
}) do
local status_ok, fault = pcall(require, source)
if not status_ok then
vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault)
end
end