From c27e697870f8d3a5136bf09e8132ad91ba5171a8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 12 Dec 2023 14:07:43 +0100 Subject: [PATCH] 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. --- nvim/.config/nvim/init.lua | 22 +--------------------- nvim/.config/nvim/lua/core/init.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+), 21 deletions(-) create mode 100644 nvim/.config/nvim/lua/core/init.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 7525255..d9a3b72 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -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") diff --git a/nvim/.config/nvim/lua/core/init.lua b/nvim/.config/nvim/lua/core/init.lua new file mode 100644 index 0000000..035fe11 --- /dev/null +++ b/nvim/.config/nvim/lua/core/init.lua @@ -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