refactor(nvim): split up init.lua

This commit is contained in:
Michael Mandl 2024-07-29 13:13:03 +02:00
parent 5a01031a10
commit 4d111dd744
Signed by: mandlm
GPG key ID: 088ED38F036C7AF2
3 changed files with 73 additions and 46 deletions

View file

@ -132,43 +132,32 @@
vimwiki-markdown vimwiki-markdown
]; ];
extraLuaPackages = luaPackages: [
luaPackages.lua-utils-nvim
luaPackages.pathlib-nvim
];
extraLuaConfig = '' extraLuaConfig = ''
${builtins.readFile ./keymaps.lua } require("local_keymaps")
${builtins.readFile ./options.lua } require("local_options")
${builtins.readFile ./commands.lua } require("local_commands")
${builtins.readFile ./treesitter.lua } require("local_treesitter")
${builtins.readFile ./lspconfig.lua } require("local_lspconfig")
${builtins.readFile ./auto-session.lua } require("local_auto-session")
${builtins.readFile ./toggleterm.lua } require("local_toggleterm")
${builtins.readFile ./notify.lua } require("local_notify")
${builtins.readFile ./comment.lua } require("local_comment")
${builtins.readFile ./lualine.lua } require("local_lualine")
${builtins.readFile ./tabline.lua } require("local_tabline")
${builtins.readFile ./indent-blankline.lua } require("local_indent-blankline")
${builtins.readFile ./gitsigns.lua } require("local_gitsigns")
${builtins.readFile ./luasnip.lua } require("local_luasnip")
${builtins.readFile ./nvim-cmp.lua } require("local_nvim-cmp")
${builtins.readFile ./telescope.lua } require("local_telescope")
do require("local_themes").setup("${theme}")
local vim_theme = "${theme}";
${builtins.readFile ./themes.lua }
end
${builtins.readFile ./project-nvim.lua } require("local_project-nvim")
${builtins.readFile ./dap.lua } require("local_dap")
${builtins.readFile ./illuminate.lua } require("local_illuminate")
${builtins.readFile ./wilder.lua } require("local_wilder")
do require("local_vimwiki").setup("${vimwikiPath}")
local vimwiki_path = "${vimwikiPath}"
${builtins.readFile ./vimwiki.lua }
end
vim.g.gitblame_date_format = "%r" vim.g.gitblame_date_format = "%r"
@ -177,4 +166,29 @@
''; '';
}; };
}; };
home.file.".config/nvim/lua/local_keymaps.lua".source = ./keymaps.lua;
home.file.".config/nvim/lua/local_options.lua".source = ./options.lua;
home.file.".config/nvim/lua/local_commands.lua".source = ./commands.lua;
home.file.".config/nvim/lua/local_treesitter.lua".source = ./treesitter.lua;
home.file.".config/nvim/lua/local_lspconfig.lua".source = ./lspconfig.lua;
home.file.".config/nvim/lua/local_auto-session.lua".source = ./auto-session.lua;
home.file.".config/nvim/lua/local_toggleterm.lua".source = ./toggleterm.lua;
home.file.".config/nvim/lua/local_notify.lua".source = ./notify.lua;
home.file.".config/nvim/lua/local_comment.lua".source = ./comment.lua;
home.file.".config/nvim/lua/local_lualine.lua".source = ./lualine.lua;
home.file.".config/nvim/lua/local_tabline.lua".source = ./tabline.lua;
home.file.".config/nvim/lua/local_indent-blankline.lua".source = ./indent-blankline.lua;
home.file.".config/nvim/lua/local_gitsigns.lua".source = ./gitsigns.lua;
home.file.".config/nvim/lua/local_luasnip.lua".source = ./luasnip.lua;
home.file.".config/nvim/lua/local_nvim-cmp.lua".source = ./nvim-cmp.lua;
home.file.".config/nvim/lua/local_telescope.lua".source = ./telescope.lua;
home.file.".config/nvim/lua/local_themes.lua".source = ./themes.lua;
home.file.".config/nvim/lua/local_vimwiki.lua".source = ./vimwiki.lua;
home.file.".config/nvim/lua/local_project-nvim.lua".source = ./project-nvim.lua;
home.file.".config/nvim/lua/local_dap.lua".source = ./dap.lua;
home.file.".config/nvim/lua/local_illuminate.lua".source = ./illuminate.lua;
home.file.".config/nvim/lua/local_wilder.lua".source = ./wilder.lua;
} }

View file

@ -1,2 +1,8 @@
vim.cmd("colorscheme solarized") local module = {}
vim.opt.background = vim_theme
function module.setup(theme)
vim.cmd("colorscheme solarized")
vim.opt.background = theme
end
return module

View file

@ -1,12 +1,19 @@
vim.g.vimwiki_list = { local mymodule = {}
{
path = vimwiki_path,
syntax = "markdown",
ext = ".md",
path_html = "~/vimwiki_html",
custom_wiki2html = "vimwiki_markdown",
}
}
-- disable global markdown hijacking function mymodule.setup(path)
vim.g.vimwiki_global_ext = 0 vim.g.vimwiki_list = {
{
path = path,
syntax = "markdown",
ext = ".md",
path_html = "~/vimwiki_html",
custom_wiki2html = "vimwiki_markdown",
diary_frequency = "monthly",
}
}
-- disable global markdown hijacking
vim.g.vimwiki_global_ext = 0
end
return mymodule