Refactor neovim config file structure

All plugins are now in their own files with their lazy specifications
and configurations. Also moved lazy initialization to init.lua because
it is very compact now
This commit is contained in:
Marko Korhonen 2023-11-18 02:27:14 +02:00
parent 94244ca95c
commit f44e0b3274
36 changed files with 554 additions and 584 deletions

View file

@ -1,20 +1,28 @@
return function()
local keymap = vim.keymap
local o = vim.o
local ufo = require("ufo")
ufo.setup({
-- Better folds
-- Disabled for now because it causes weird artifacts
return {
enabled = false,
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
opts = {
close_fold_kinds = {
"imports",
},
})
},
config = function(spec)
local ufo = require("ufo")
ufo.setup(spec.opts)
-- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
keymap.set("n", "zR", ufo.openAllFolds)
keymap.set("n", "zM", ufo.closeAllFolds)
-- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
local keymap = vim.keymap
keymap.set("n", "zR", ufo.openAllFolds)
keymap.set("n", "zM", ufo.closeAllFolds)
-- Fold settings
o.foldcolumn = "1"
o.foldlevel = 99
o.foldlevelstart = 99
o.foldenable = true
end
-- Fold settings
local o = vim.o
o.foldcolumn = "1"
o.foldlevel = 99
o.foldlevelstart = 99
o.foldenable = true
end,
}