diff --git a/neovim/default.nix b/neovim/default.nix index 5bc4137..faf5955 100644 --- a/neovim/default.nix +++ b/neovim/default.nix @@ -132,43 +132,32 @@ vimwiki-markdown ]; - extraLuaPackages = luaPackages: [ - luaPackages.lua-utils-nvim - luaPackages.pathlib-nvim - ]; - extraLuaConfig = '' - ${builtins.readFile ./keymaps.lua } - ${builtins.readFile ./options.lua } - ${builtins.readFile ./commands.lua } - ${builtins.readFile ./treesitter.lua } - ${builtins.readFile ./lspconfig.lua } - ${builtins.readFile ./auto-session.lua } - ${builtins.readFile ./toggleterm.lua } - ${builtins.readFile ./notify.lua } - ${builtins.readFile ./comment.lua } - ${builtins.readFile ./lualine.lua } - ${builtins.readFile ./tabline.lua } - ${builtins.readFile ./indent-blankline.lua } - ${builtins.readFile ./gitsigns.lua } - ${builtins.readFile ./luasnip.lua } - ${builtins.readFile ./nvim-cmp.lua } - ${builtins.readFile ./telescope.lua } + require("local_keymaps") + require("local_options") + require("local_commands") + require("local_treesitter") + require("local_lspconfig") + require("local_auto-session") + require("local_toggleterm") + require("local_notify") + require("local_comment") + require("local_lualine") + require("local_tabline") + require("local_indent-blankline") + require("local_gitsigns") + require("local_luasnip") + require("local_nvim-cmp") + require("local_telescope") - do - local vim_theme = "${theme}"; - ${builtins.readFile ./themes.lua } - end + require("local_themes").setup("${theme}") - ${builtins.readFile ./project-nvim.lua } - ${builtins.readFile ./dap.lua } - ${builtins.readFile ./illuminate.lua } - ${builtins.readFile ./wilder.lua } + require("local_project-nvim") + require("local_dap") + require("local_illuminate") + require("local_wilder") - do - local vimwiki_path = "${vimwikiPath}" - ${builtins.readFile ./vimwiki.lua } - end + require("local_vimwiki").setup("${vimwikiPath}") 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; } diff --git a/neovim/themes.lua b/neovim/themes.lua index 2b7d93b..b463ac3 100644 --- a/neovim/themes.lua +++ b/neovim/themes.lua @@ -1,2 +1,8 @@ -vim.cmd("colorscheme solarized") -vim.opt.background = vim_theme +local module = {} + +function module.setup(theme) + vim.cmd("colorscheme solarized") + vim.opt.background = theme +end + +return module diff --git a/neovim/vimwiki.lua b/neovim/vimwiki.lua index d79e6cc..0addc9f 100644 --- a/neovim/vimwiki.lua +++ b/neovim/vimwiki.lua @@ -1,12 +1,19 @@ -vim.g.vimwiki_list = { - { - path = vimwiki_path, - syntax = "markdown", - ext = ".md", - path_html = "~/vimwiki_html", - custom_wiki2html = "vimwiki_markdown", - } -} +local mymodule = {} --- disable global markdown hijacking -vim.g.vimwiki_global_ext = 0 +function mymodule.setup(path) + 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