diff --git a/modules/plugins/assistant/chatgpt/config.nix b/modules/plugins/assistant/chatgpt/config.nix index 79db0d9..3caa221 100644 --- a/modules/plugins/assistant/chatgpt/config.nix +++ b/modules/plugins/assistant/chatgpt/config.nix @@ -33,7 +33,7 @@ in { startPlugins = [ "chatgpt" ]; - luaConfigRC.chagpt = entryAnywhere '' + pluginRC.chagpt = entryAnywhere '' require("chatgpt").setup(${toLuaObject cfg.setupOpts}) ''; maps.normal = mkMerge [ diff --git a/modules/plugins/assistant/copilot/config.nix b/modules/plugins/assistant/copilot/config.nix index b7adc82..c9e6f83 100644 --- a/modules/plugins/assistant/copilot/config.nix +++ b/modules/plugins/assistant/copilot/config.nix @@ -34,7 +34,7 @@ in { "copilot-cmp" ]; - vim.luaConfigRC.copilot = entryAnywhere '' + vim.pluginRC.copilot = entryAnywhere '' require("copilot").setup(${toLuaObject cfg.setupOpts}) ${lib.optionalString cfg.cmp.enable '' diff --git a/modules/plugins/autopairs/nvim-autopairs/config.nix b/modules/plugins/autopairs/nvim-autopairs/config.nix index 3a20960..6ef7cbf 100644 --- a/modules/plugins/autopairs/nvim-autopairs/config.nix +++ b/modules/plugins/autopairs/nvim-autopairs/config.nix @@ -12,7 +12,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["nvim-autopairs"]; - vim.luaConfigRC.autopairs = entryAnywhere '' + vim.pluginRC.autopairs = entryAnywhere '' require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} }) ''; }; diff --git a/modules/plugins/comments/comment-nvim/config.nix b/modules/plugins/comments/comment-nvim/config.nix index 40ccb0a..e70e918 100644 --- a/modules/plugins/comments/comment-nvim/config.nix +++ b/modules/plugins/comments/comment-nvim/config.nix @@ -41,7 +41,7 @@ in { (mkBinding cfg.mappings.toggleSelectedBlock "(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description) ]; - vim.luaConfigRC.comment-nvim = entryAnywhere '' + vim.pluginRC.comment-nvim = entryAnywhere '' require('Comment').setup({ mappings = { basic = false, extra = false, }, }) diff --git a/modules/plugins/completion/nvim-cmp/config.nix b/modules/plugins/completion/nvim-cmp/config.nix index 9e27607..a28db3e 100644 --- a/modules/plugins/completion/nvim-cmp/config.nix +++ b/modules/plugins/completion/nvim-cmp/config.nix @@ -186,7 +186,7 @@ in { # TODO: alternative snippet engines to vsnip # https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L82 - vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement '' + vim.pluginRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement '' local nvim_cmp_menu_map = function(entry, vim_item) -- name for each source vim_item.menu = ({ diff --git a/modules/plugins/dashboard/alpha/config.nix b/modules/plugins/dashboard/alpha/config.nix index 12072e3..bb648a5 100644 --- a/modules/plugins/dashboard/alpha/config.nix +++ b/modules/plugins/dashboard/alpha/config.nix @@ -16,7 +16,7 @@ in { # the entire credit for this dashboard configuration to https://github.com/Rishabh672003 # honestly, excellent work - vim.luaConfigRC.alpha = entryAnywhere '' + vim.pluginRC.alpha = entryAnywhere '' local alpha = require("alpha") local plenary_path = require("plenary.path") local dashboard = require("alpha.themes.dashboard") diff --git a/modules/plugins/dashboard/dashboard-nvim/config.nix b/modules/plugins/dashboard/dashboard-nvim/config.nix index 9d827a4..088842a 100644 --- a/modules/plugins/dashboard/dashboard-nvim/config.nix +++ b/modules/plugins/dashboard/dashboard-nvim/config.nix @@ -13,7 +13,7 @@ in { "dashboard-nvim" ]; - vim.luaConfigRC.dashboard-nvim = entryAnywhere '' + vim.pluginRC.dashboard-nvim = entryAnywhere '' require("dashboard").setup{} ''; }; diff --git a/modules/plugins/debugger/nvim-dap/config.nix b/modules/plugins/debugger/nvim-dap/config.nix index b26a5bd..072ad9a 100644 --- a/modules/plugins/debugger/nvim-dap/config.nix +++ b/modules/plugins/debugger/nvim-dap/config.nix @@ -18,7 +18,7 @@ in { (mkIf cfg.enable { vim.startPlugins = ["nvim-dap"]; - vim.luaConfigRC = + vim.pluginRC = { # TODO customizable keymaps nvim-dap = entryAnywhere '' @@ -51,7 +51,7 @@ in { (mkIf (cfg.enable && cfg.ui.enable) { vim.startPlugins = ["nvim-dap-ui" "nvim-nio"]; - vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] ('' + vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] ('' local dapui = require("dapui") dapui.setup() '' diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index f016191..b97b1e4 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -29,7 +29,7 @@ in { "t" = "+NvimTree"; }; - vim.luaConfigRC.nvimtreelua = entryAnywhere '' + vim.pluginRC.nvimtreelua = entryAnywhere '' ${ optionalString cfg.setupOpts.disable_netrw '' -- disable netrew completely diff --git a/modules/plugins/git/gitsigns/config.nix b/modules/plugins/git/gitsigns/config.nix index b0aac94..039ab63 100644 --- a/modules/plugins/git/gitsigns/config.nix +++ b/modules/plugins/git/gitsigns/config.nix @@ -69,7 +69,7 @@ in { "g" = "+Gitsigns"; }; - luaConfigRC.gitsigns = entryAnywhere '' + pluginRC.gitsigns = entryAnywhere '' require('gitsigns').setup{} ''; }; diff --git a/modules/plugins/languages/clang.nix b/modules/plugins/languages/clang.nix index aa9dfcb..0b3ffcf 100644 --- a/modules/plugins/languages/clang.nix +++ b/modules/plugins/languages/clang.nix @@ -141,7 +141,7 @@ in { config = mkIf cfg.enable (mkMerge [ (mkIf cfg.cHeader { - vim.luaConfigRC.c-header = entryAfter ["basic"] "vim.g.c_syntax_for_h = 1"; + vim.pluginRC.c-header = entryAfter ["basic"] "vim.g.c_syntax_for_h = 1"; }) (mkIf cfg.treesitter.enable { diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index 8f957c9..ee069a7 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -140,7 +140,7 @@ in { then ["flutter-tools-patched"] else ["flutter-tools"]; - vim.luaConfigRC.flutter-tools = entryAnywhere '' + vim.pluginRC.flutter-tools = entryAnywhere '' require('flutter-tools').setup { lsp = { color = { -- show the derived colours for dart variables diff --git a/modules/plugins/languages/elixir.nix b/modules/plugins/languages/elixir.nix index 7f969ad..1a57d78 100644 --- a/modules/plugins/languages/elixir.nix +++ b/modules/plugins/languages/elixir.nix @@ -113,7 +113,7 @@ in { (mkIf cfg.elixir-tools.enable { vim.startPlugins = ["elixir-tools"]; - vim.luaConfigRC.elixir-tools = entryAnywhere '' + vim.pluginRC.elixir-tools = entryAnywhere '' local elixir-tools = require("elixir") local elixirls = require("elixir-tools.elixirls") diff --git a/modules/plugins/languages/go.nix b/modules/plugins/languages/go.nix index 05e28ed..e0eded0 100644 --- a/modules/plugins/languages/go.nix +++ b/modules/plugins/languages/go.nix @@ -102,7 +102,7 @@ in { (mkIf cfg.dap.enable { vim = { startPlugins = ["nvim-dap-go"]; - luaConfigRC.nvim-dap-go = entryAfter ["nvim-dap"] '' + pluginRC.nvim-dap-go = entryAfter ["nvim-dap"] '' require('dap-go').setup { delve = { path = '${getExe cfg.dap.package}', diff --git a/modules/plugins/languages/html.nix b/modules/plugins/languages/html.nix index a4cf238..0bef276 100644 --- a/modules/plugins/languages/html.nix +++ b/modules/plugins/languages/html.nix @@ -36,7 +36,7 @@ in { grammars = [cfg.treesitter.package]; }; - luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere '' + pluginRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere '' require('nvim-ts-autotag').setup() ''); }; diff --git a/modules/plugins/languages/lua.nix b/modules/plugins/languages/lua.nix index 7cbacb6..5ceed3e 100644 --- a/modules/plugins/languages/lua.nix +++ b/modules/plugins/languages/lua.nix @@ -61,7 +61,7 @@ in { (mkIf cfg.lsp.neodev.enable { vim.startPlugins = ["neodev-nvim"]; - vim.luaConfigRC.neodev = entryBefore ["lua-lsp"] '' + vim.pluginRC.neodev = entryBefore ["lua-lsp"] '' require("neodev").setup({}) ''; }) diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 7c0a94b..a45cdcb 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -176,7 +176,7 @@ in { config = mkIf cfg.enable (mkMerge [ { - vim.luaConfigRC.nix = '' + vim.pluginRC.nix = '' vim.api.nvim_create_autocmd("FileType", { pattern = "nix", callback = function(opts) diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index 0753ab4..277b601 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -102,7 +102,7 @@ in { startPlugins = ["crates-nvim"]; lsp.null-ls.enable = mkIf cfg.crates.codeActions true; autocomplete.sources = {"crates" = "[Crates]";}; - luaConfigRC.rust-crates = entryAnywhere '' + pluginRC.rust-crates = entryAnywhere '' require('crates').setup { null_ls = { enabled = ${boolToString cfg.crates.codeActions}, diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index 3478d4f..dd1bde6 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -192,7 +192,7 @@ in { (mkIf cfg.extensions."ts-error-translator".enable { vim.startPlugins = ["ts-error-translator"]; - vim.luaConfigRC.ts-error-translator = entryAnywhere '' + vim.pluginRC.ts-error-translator = entryAnywhere '' require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts}) ''; }) diff --git a/modules/plugins/lsp/config.nix b/modules/plugins/lsp/config.nix index 93e3da6..a0aa7fe 100644 --- a/modules/plugins/lsp/config.nix +++ b/modules/plugins/lsp/config.nix @@ -27,7 +27,7 @@ in { autocomplete.sources = {"nvim_lsp" = "[LSP]";}; - luaConfigRC.lsp-setup = '' + pluginRC.lsp-setup = '' vim.g.formatsave = ${boolToString cfg.formatOnSave}; local attach_keymaps = function(client, bufnr) diff --git a/modules/plugins/lsp/lightbulb/config.nix b/modules/plugins/lsp/lightbulb/config.nix index ef2239f..f44c2dd 100644 --- a/modules/plugins/lsp/lightbulb/config.nix +++ b/modules/plugins/lsp/lightbulb/config.nix @@ -12,7 +12,7 @@ in { vim = { startPlugins = ["nvim-lightbulb"]; - luaConfigRC.lightbulb = entryAnywhere '' + pluginRC.lightbulb = entryAnywhere '' vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()') -- Enable trouble diagnostics viewer diff --git a/modules/plugins/lsp/lsp-signature/config.nix b/modules/plugins/lsp/lsp-signature/config.nix index c194912..c994053 100644 --- a/modules/plugins/lsp/lsp-signature/config.nix +++ b/modules/plugins/lsp/lsp-signature/config.nix @@ -20,7 +20,7 @@ in { handler_opts.border = config.vim.ui.borders.plugins.lsp-signature.style; }; - luaConfigRC.lsp-signature = entryAnywhere '' + pluginRC.lsp-signature = entryAnywhere '' -- Enable lsp signature viewer require("lsp_signature").setup(${toLuaObject cfg.lspSignature.setupOpts}) ''; diff --git a/modules/plugins/lsp/lspconfig/config.nix b/modules/plugins/lsp/lspconfig/config.nix index 1736ce9..15d42fd 100644 --- a/modules/plugins/lsp/lspconfig/config.nix +++ b/modules/plugins/lsp/lspconfig/config.nix @@ -17,7 +17,7 @@ in { startPlugins = ["nvim-lspconfig"]; - luaConfigRC.lspconfig = entryAfter ["lsp-setup"] '' + pluginRC.lspconfig = entryAfter ["lsp-setup"] '' local lspconfig = require('lspconfig') ${ @@ -29,7 +29,7 @@ in { }; } { - vim.luaConfigRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources; + vim.pluginRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources; } ]); } diff --git a/modules/plugins/lsp/lspkind/config.nix b/modules/plugins/lsp/lspkind/config.nix index a98aeab..93426e0 100644 --- a/modules/plugins/lsp/lspkind/config.nix +++ b/modules/plugins/lsp/lspkind/config.nix @@ -10,7 +10,7 @@ in { config = mkIf (cfg.enable && cfg.lspkind.enable) { vim.startPlugins = ["lspkind"]; - vim.luaConfigRC.lspkind = entryAnywhere '' + vim.pluginRC.lspkind = entryAnywhere '' local lspkind = require'lspkind' local lspkind_opts = { mode = '${cfg.lspkind.mode}' diff --git a/modules/plugins/lsp/lsplines/config.nix b/modules/plugins/lsp/lsplines/config.nix index 3436f64..bb07edc 100644 --- a/modules/plugins/lsp/lsplines/config.nix +++ b/modules/plugins/lsp/lsplines/config.nix @@ -10,7 +10,7 @@ in { config = mkIf (cfg.enable && cfg.lsplines.enable) { vim.startPlugins = ["lsp-lines"]; - vim.luaConfigRC.lsplines = entryAfter ["lspconfig"] '' + vim.pluginRC.lsplines = entryAfter ["lspconfig"] '' require("lsp_lines").setup() vim.diagnostic.config({ diff --git a/modules/plugins/lsp/lspsaga/config.nix b/modules/plugins/lsp/lspsaga/config.nix index ffacf12..71c9025 100644 --- a/modules/plugins/lsp/lspsaga/config.nix +++ b/modules/plugins/lsp/lspsaga/config.nix @@ -41,7 +41,7 @@ in { ]; }; - luaConfigRC.lspsaga = entryAnywhere '' + pluginRC.lspsaga = entryAnywhere '' require('lspsaga').init_lsp_saga({ ${optionalString config.vim.ui.borders.plugins.lspsaga.enable '' border_style = '${config.vim.ui.borders.plugins.lspsaga.style}', diff --git a/modules/plugins/lsp/null-ls/config.nix b/modules/plugins/lsp/null-ls/config.nix index e0d1694..8e776ed 100644 --- a/modules/plugins/lsp/null-ls/config.nix +++ b/modules/plugins/lsp/null-ls/config.nix @@ -22,7 +22,7 @@ in { # since it will hook into LSPs to receive information lsp.enable = true; - luaConfigRC = { + pluginRC = { # early setup for null-ls null_ls-setup = entryAnywhere '' local null_ls = require("null-ls") @@ -46,7 +46,7 @@ in { }; } { - vim.luaConfigRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources; + vim.pluginRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources; } ]); } diff --git a/modules/plugins/lsp/nvim-code-action-menu/config.nix b/modules/plugins/lsp/nvim-code-action-menu/config.nix index e55fb4a..9acc34d 100644 --- a/modules/plugins/lsp/nvim-code-action-menu/config.nix +++ b/modules/plugins/lsp/nvim-code-action-menu/config.nix @@ -23,7 +23,7 @@ in { "c" = "+CodeAction"; }; - luaConfigRC.code-action-menu = entryAnywhere '' + pluginRC.code-action-menu = entryAnywhere '' -- border configuration vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}' diff --git a/modules/plugins/lsp/nvim-docs-view/config.nix b/modules/plugins/lsp/nvim-docs-view/config.nix index 45de200..5c7ad2b 100644 --- a/modules/plugins/lsp/nvim-docs-view/config.nix +++ b/modules/plugins/lsp/nvim-docs-view/config.nix @@ -19,7 +19,7 @@ in { lsp.enable = true; startPlugins = ["nvim-docs-view"]; - luaConfigRC.nvim-docs-view = entryAnywhere '' + pluginRC.nvim-docs-view = entryAnywhere '' require("docs-view").setup ${toLuaObject cfg.setupOpts} ''; diff --git a/modules/plugins/lsp/trouble/config.nix b/modules/plugins/lsp/trouble/config.nix index 72fc1ec..dd853e3 100644 --- a/modules/plugins/lsp/trouble/config.nix +++ b/modules/plugins/lsp/trouble/config.nix @@ -32,7 +32,7 @@ in { "lw" = "Workspace"; }; - luaConfigRC.trouble = entryAnywhere '' + pluginRC.trouble = entryAnywhere '' -- Enable trouble diagnostics viewer require("trouble").setup {} ''; diff --git a/modules/plugins/minimap/codewindow/config.nix b/modules/plugins/minimap/codewindow/config.nix index 11c38c9..a853514 100644 --- a/modules/plugins/minimap/codewindow/config.nix +++ b/modules/plugins/minimap/codewindow/config.nix @@ -31,7 +31,7 @@ in { "m" = "+Minimap"; }; - luaConfigRC.codewindow = entryAnywhere '' + pluginRC.codewindow = entryAnywhere '' local codewindow = require('codewindow') codewindow.setup({ exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'}, diff --git a/modules/plugins/notes/mind-nvim/config.nix b/modules/plugins/notes/mind-nvim/config.nix index 7f7ea9d..e0794b6 100644 --- a/modules/plugins/notes/mind-nvim/config.nix +++ b/modules/plugins/notes/mind-nvim/config.nix @@ -25,7 +25,7 @@ in { "o" = "+Notes"; }; - luaConfigRC.mind-nvim = entryAnywhere '' + pluginRC.mind-nvim = entryAnywhere '' require'mind'.setup() ''; }; diff --git a/modules/plugins/notes/obsidian/config.nix b/modules/plugins/notes/obsidian/config.nix index 5ba005e..835bc17 100644 --- a/modules/plugins/notes/obsidian/config.nix +++ b/modules/plugins/notes/obsidian/config.nix @@ -22,7 +22,7 @@ in { "o" = "+Notes"; }; - luaConfigRC.obsidian = entryAnywhere '' + pluginRC.obsidian = entryAnywhere '' require("obsidian").setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/notes/orgmode/config.nix b/modules/plugins/notes/orgmode/config.nix index d8c4906..36e0808 100644 --- a/modules/plugins/notes/orgmode/config.nix +++ b/modules/plugins/notes/orgmode/config.nix @@ -21,7 +21,7 @@ in { "o" = "+Notes"; }; - luaConfigRC.orgmode = entryAnywhere '' + pluginRC.orgmode = entryAnywhere '' -- Treesitter configuration require('nvim-treesitter.configs').setup { diff --git a/modules/plugins/notes/todo-comments/config.nix b/modules/plugins/notes/todo-comments/config.nix index cb7d628..645f677 100644 --- a/modules/plugins/notes/todo-comments/config.nix +++ b/modules/plugins/notes/todo-comments/config.nix @@ -24,7 +24,7 @@ in { (mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble" mappings.trouble.description)) ]; - luaConfigRC.todo-comments = '' + pluginRC.todo-comments = '' require('todo-comments').setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/projects/project-nvim/config.nix b/modules/plugins/projects/project-nvim/config.nix index 0f85968..b985a07 100644 --- a/modules/plugins/projects/project-nvim/config.nix +++ b/modules/plugins/projects/project-nvim/config.nix @@ -14,7 +14,7 @@ in { "project-nvim" ]; - vim.luaConfigRC.project-nvim = entryAnywhere '' + vim.pluginRC.project-nvim = entryAnywhere '' require('project_nvim').setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/rich-presence/neocord/config.nix b/modules/plugins/rich-presence/neocord/config.nix index a6dcbb5..8100b2b 100644 --- a/modules/plugins/rich-presence/neocord/config.nix +++ b/modules/plugins/rich-presence/neocord/config.nix @@ -12,7 +12,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["neocord"]; - vim.luaConfigRC.neocord = entryAnywhere '' + vim.pluginRC.neocord = entryAnywhere '' -- Description of each option can be found in https://github.com/IogaMaster/neocord#lua require("neocord").setup(${toLuaObject cfg.setupOpts}) ''; diff --git a/modules/plugins/session/nvim-session-manager/config.nix b/modules/plugins/session/nvim-session-manager/config.nix index c86c13f..5d345c7 100644 --- a/modules/plugins/session/nvim-session-manager/config.nix +++ b/modules/plugins/session/nvim-session-manager/config.nix @@ -28,7 +28,7 @@ in { # TODO: load_current_dir_session ]; - luaConfigRC.nvim-session-manager = entryAnywhere '' + pluginRC.nvim-session-manager = entryAnywhere '' local Path = require('plenary.path') local sm = require('session_manager.config') require('session_manager').setup(${toLuaObject cfg.setupOpts}) diff --git a/modules/plugins/spellcheck/vim-dirtytalk/config.nix b/modules/plugins/spellcheck/vim-dirtytalk/config.nix index bef92e5..08426d1 100644 --- a/modules/plugins/spellcheck/vim-dirtytalk/config.nix +++ b/modules/plugins/spellcheck/vim-dirtytalk/config.nix @@ -14,7 +14,7 @@ in { # vim-dirtytalk doesn't have any setup # but we would like to append programming to spelllang # as soon as possible while the plugin is enabled - luaConfigRC.vim-dirtytalk = entryAfter ["basic"] '' + pluginRC.vim-dirtytalk = entryAfter ["basic"] '' -- append programming to spelllang vim.opt.spelllang:append("programming") ''; diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index 6c61367..d519199 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -35,7 +35,7 @@ in { vim = { startPlugins = ["lualine"]; - luaConfigRC.lualine = entryAnywhere '' + pluginRC.lualine = entryAnywhere '' local lualine = require('lualine') lualine.setup ${toLuaObject cfg.setupOpts} ''; diff --git a/modules/plugins/tabline/nvim-bufferline/config.nix b/modules/plugins/tabline/nvim-bufferline/config.nix index 59363f8..fe54efb 100644 --- a/modules/plugins/tabline/nvim-bufferline/config.nix +++ b/modules/plugins/tabline/nvim-bufferline/config.nix @@ -39,7 +39,7 @@ in { "bsi" = "BufferLineSortById"; }; - luaConfigRC.nvimBufferline = entryAnywhere '' + pluginRC.nvimBufferline = entryAnywhere '' require("bufferline").setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/terminal/toggleterm/config.nix b/modules/plugins/terminal/toggleterm/config.nix index 7f57358..07851e4 100644 --- a/modules/plugins/terminal/toggleterm/config.nix +++ b/modules/plugins/terminal/toggleterm/config.nix @@ -23,7 +23,7 @@ in { maps.normal = mkBinding cfg.mappings.open "execute v:count . \"ToggleTerm\"" "Toggle terminal"; - luaConfigRC.toggleterm = entryAnywhere '' + pluginRC.toggleterm = entryAnywhere '' require("toggleterm").setup(${toLuaObject cfg.setupOpts}) ''; }; @@ -35,7 +35,7 @@ in { vim.startPlugins = optionals (cfg.lazygit.package != null) [ cfg.lazygit.package ]; - vim.luaConfigRC.toggleterm-lazygit = entryAfter ["toggleterm"] '' + vim.pluginRC.toggleterm-lazygit = entryAfter ["toggleterm"] '' local terminal = require 'toggleterm.terminal' local lazygit = terminal.Terminal:new({ cmd = '${ diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index bcd451f..618da88 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -37,7 +37,7 @@ in { }; # For some reason treesitter highlighting does not work on start if this is set before syntax on - luaConfigRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] '' + pluginRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] '' -- This is required by treesitter-context to handle folds vim.o.foldmethod = "expr" vim.o.foldexpr = "nvim_treesitter#foldexpr()" @@ -48,7 +48,7 @@ in { vim.o.foldenable = false ''); - luaConfigRC.treesitter = entryAfter ["basic"] '' + pluginRC.treesitter = entryAfter ["basic"] '' require('nvim-treesitter.configs').setup { -- Disable imperative treesitter options that would attempt to fetch -- grammars into the read-only Nix store. To add additional grammars here diff --git a/modules/plugins/treesitter/ts-context/config.nix b/modules/plugins/treesitter/ts-context/config.nix index df5c151..416446f 100644 --- a/modules/plugins/treesitter/ts-context/config.nix +++ b/modules/plugins/treesitter/ts-context/config.nix @@ -16,7 +16,7 @@ in { # set up treesitter-context after Treesitter. The ordering # should not matter, but there is no harm in doing this - luaConfigRC.treesitter-context = entryAfter ["treesitter"] '' + pluginRC.treesitter-context = entryAfter ["treesitter"] '' require("treesitter-context").setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/ui/breadcrumbs/config.nix b/modules/plugins/ui/breadcrumbs/config.nix index 35c08ec..747a777 100644 --- a/modules/plugins/ui/breadcrumbs/config.nix +++ b/modules/plugins/ui/breadcrumbs/config.nix @@ -78,7 +78,7 @@ in { }; }; - vim.luaConfigRC.breadcrumbs = entryAfter ["lspconfig"] '' + vim.pluginRC.breadcrumbs = entryAfter ["lspconfig"] '' ${optionalString (cfg.source == "nvim-navic") '' local navic = require("nvim-navic") diff --git a/modules/plugins/ui/colorizer/config.nix b/modules/plugins/ui/colorizer/config.nix index 1ff45f6..ef5a5e6 100644 --- a/modules/plugins/ui/colorizer/config.nix +++ b/modules/plugins/ui/colorizer/config.nix @@ -14,7 +14,7 @@ in { "nvim-colorizer-lua" ]; - vim.luaConfigRC.colorizer = entryAnywhere '' + vim.pluginRC.colorizer = entryAnywhere '' require('colorizer').setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/ui/illuminate/config.nix b/modules/plugins/ui/illuminate/config.nix index 6d08c76..ffba85f 100644 --- a/modules/plugins/ui/illuminate/config.nix +++ b/modules/plugins/ui/illuminate/config.nix @@ -11,7 +11,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["vim-illuminate"]; - vim.luaConfigRC.vim-illuminate = entryAnywhere '' + vim.pluginRC.vim-illuminate = entryAnywhere '' require('illuminate').configure({ filetypes_denylist = { 'dirvish', diff --git a/modules/plugins/ui/modes/config.nix b/modules/plugins/ui/modes/config.nix index 9f49dc4..2ea9602 100644 --- a/modules/plugins/ui/modes/config.nix +++ b/modules/plugins/ui/modes/config.nix @@ -14,7 +14,7 @@ in { "modes-nvim" ]; - vim.luaConfigRC.modes-nvim = entryAnywhere '' + vim.pluginRC.modes-nvim = entryAnywhere '' require('modes').setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/ui/noice/config.nix b/modules/plugins/ui/noice/config.nix index d3ebe01..fe82f58 100644 --- a/modules/plugins/ui/noice/config.nix +++ b/modules/plugins/ui/noice/config.nix @@ -23,7 +23,7 @@ in { treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars; - luaConfigRC.noice-nvim = entryAnywhere '' + pluginRC.noice-nvim = entryAnywhere '' require("noice").setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/ui/notifications/nvim-notify/config.nix b/modules/plugins/ui/notifications/nvim-notify/config.nix index 7a11b6b..0ee2301 100644 --- a/modules/plugins/ui/notifications/nvim-notify/config.nix +++ b/modules/plugins/ui/notifications/nvim-notify/config.nix @@ -13,7 +13,7 @@ in { vim = { startPlugins = ["nvim-notify"]; - luaConfigRC.nvim-notify = entryAnywhere '' + pluginRC.nvim-notify = entryAnywhere '' require('notify').setup(${toLuaObject cfg.setupOpts}) -- required to fix offset_encoding errors diff --git a/modules/plugins/ui/smartcolumn/config.nix b/modules/plugins/ui/smartcolumn/config.nix index 9edbdbb..f38edfd 100644 --- a/modules/plugins/ui/smartcolumn/config.nix +++ b/modules/plugins/ui/smartcolumn/config.nix @@ -13,7 +13,7 @@ in { vim = { startPlugins = ["smartcolumn"]; - luaConfigRC.smartcolumn = entryAnywhere '' + pluginRC.smartcolumn = entryAnywhere '' require("smartcolumn").setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/plugins/utility/binds/cheatsheet/config.nix b/modules/plugins/utility/binds/cheatsheet/config.nix index 05b7887..2848ddc 100644 --- a/modules/plugins/utility/binds/cheatsheet/config.nix +++ b/modules/plugins/utility/binds/cheatsheet/config.nix @@ -11,7 +11,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["cheatsheet-nvim"]; - vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere '' + vim.pluginRC.cheaetsheet-nvim = entryAnywhere '' require('cheatsheet').setup({}) ''; }; diff --git a/modules/plugins/utility/binds/which-key/config.nix b/modules/plugins/utility/binds/which-key/config.nix index e6aa2d9..03c85b4 100644 --- a/modules/plugins/utility/binds/which-key/config.nix +++ b/modules/plugins/utility/binds/which-key/config.nix @@ -13,7 +13,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["which-key"]; - vim.luaConfigRC.whichkey = entryAnywhere '' + vim.pluginRC.whichkey = entryAnywhere '' local wk = require("which-key") wk.setup ({ key_labels = { diff --git a/modules/plugins/utility/ccc/config.nix b/modules/plugins/utility/ccc/config.nix index b8c4315..ab2d178 100644 --- a/modules/plugins/utility/ccc/config.nix +++ b/modules/plugins/utility/ccc/config.nix @@ -13,7 +13,7 @@ in { "ccc" ]; - vim.luaConfigRC.ccc = entryAnywhere '' + vim.pluginRC.ccc = entryAnywhere '' local ccc = require("ccc") ccc.setup { highlighter = { diff --git a/modules/plugins/utility/gestures/gesture-nvim/config.nix b/modules/plugins/utility/gestures/gesture-nvim/config.nix index 62a89ce..2996f7d 100644 --- a/modules/plugins/utility/gestures/gesture-nvim/config.nix +++ b/modules/plugins/utility/gestures/gesture-nvim/config.nix @@ -25,7 +25,7 @@ in { }) ]; - vim.luaConfigRC.gesture-nvim = entryAnywhere '' + vim.pluginRC.gesture-nvim = entryAnywhere '' vim.opt.mouse = "a" local gesture = require("gesture") diff --git a/modules/plugins/utility/icon-picker/config.nix b/modules/plugins/utility/icon-picker/config.nix index aa61d04..405f691 100644 --- a/modules/plugins/utility/icon-picker/config.nix +++ b/modules/plugins/utility/icon-picker/config.nix @@ -14,7 +14,7 @@ in { "dressing-nvim" ]; - vim.luaConfigRC.icon-picker = entryAnywhere '' + vim.pluginRC.icon-picker = entryAnywhere '' require("icon-picker").setup({ disable_legacy_commands = true }) diff --git a/modules/plugins/utility/images/image-nvim/config.nix b/modules/plugins/utility/images/image-nvim/config.nix index 52666d3..7ab4ba7 100644 --- a/modules/plugins/utility/images/image-nvim/config.nix +++ b/modules/plugins/utility/images/image-nvim/config.nix @@ -19,7 +19,7 @@ in { "magick" ]; - luaConfigRC.image-nvim = entryAnywhere '' + pluginRC.image-nvim = entryAnywhere '' require("image").setup( ${toLuaObject cfg.setupOpts} ) diff --git a/modules/plugins/utility/motion/hop/config.nix b/modules/plugins/utility/motion/hop/config.nix index 94c4a8c..505b9eb 100644 --- a/modules/plugins/utility/motion/hop/config.nix +++ b/modules/plugins/utility/motion/hop/config.nix @@ -19,7 +19,7 @@ in { vim.maps.normal = mkSetBinding mappings.hop " HopPattern"; - vim.luaConfigRC.hop-nvim = entryAnywhere '' + vim.pluginRC.hop-nvim = entryAnywhere '' require('hop').setup() ''; }; diff --git a/modules/plugins/utility/motion/leap/config.nix b/modules/plugins/utility/motion/leap/config.nix index f9a9655..9ede98f 100644 --- a/modules/plugins/utility/motion/leap/config.nix +++ b/modules/plugins/utility/motion/leap/config.nix @@ -37,7 +37,7 @@ in { (mkBinding cfg.mappings.leapFromWindow "(leap-from-window)" "Leap from window") ]; - vim.luaConfigRC.leap-nvim = entryAnywhere '' + vim.pluginRC.leap-nvim = entryAnywhere '' require('leap').opts = { max_phase_one_targets = nil, highlight_unlabeled_phase_one_targets = false, diff --git a/modules/plugins/utility/preview/glow/config.nix b/modules/plugins/utility/preview/glow/config.nix index 04e8aa0..4529a53 100644 --- a/modules/plugins/utility/preview/glow/config.nix +++ b/modules/plugins/utility/preview/glow/config.nix @@ -25,7 +25,7 @@ in { "pm" = "+Preview Markdown"; }; - vim.luaConfigRC.glow = entryAnywhere '' + vim.pluginRC.glow = entryAnywhere '' require('glow').setup({ glow_path = "${pkgs.glow}/bin/glow" }); diff --git a/modules/plugins/utility/surround/config.nix b/modules/plugins/utility/surround/config.nix index e392d9a..824b8c9 100644 --- a/modules/plugins/utility/surround/config.nix +++ b/modules/plugins/utility/surround/config.nix @@ -18,7 +18,7 @@ in { "nvim-surround" ]; - luaConfigRC.surround = entryAnywhere '' + pluginRC.surround = entryAnywhere '' require('nvim-surround').setup() ''; diff --git a/modules/plugins/utility/telescope/config.nix b/modules/plugins/utility/telescope/config.nix index f59f816..2ec7d3d 100644 --- a/modules/plugins/utility/telescope/config.nix +++ b/modules/plugins/utility/telescope/config.nix @@ -65,7 +65,7 @@ in { "fvc" = "Commits"; }; - vim.luaConfigRC.telescope = entryAnywhere '' + vim.pluginRC.telescope = entryAnywhere '' local telescope = require('telescope') telescope.setup(${toLuaObject cfg.setupOpts}) diff --git a/modules/plugins/utility/wakatime/config.nix b/modules/plugins/utility/wakatime/config.nix index ba66d97..a1892e7 100644 --- a/modules/plugins/utility/wakatime/config.nix +++ b/modules/plugins/utility/wakatime/config.nix @@ -11,7 +11,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = [pkgs.vimPlugins.vim-wakatime]; - vim.luaConfigRC.vim-wakatime = mkIf (cfg.cli-package != null) '' + vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) '' vim.g.wakatime_CLIPath = "${cfg.cli-package}" ''; }; diff --git a/modules/plugins/visuals/config.nix b/modules/plugins/visuals/config.nix index 9327cee..1dfc661 100644 --- a/modules/plugins/visuals/config.nix +++ b/modules/plugins/visuals/config.nix @@ -14,14 +14,14 @@ in { config = mkIf cfg.enable (mkMerge [ (mkIf cfg.indentBlankline.enable { vim.startPlugins = ["indent-blankline"]; - vim.luaConfigRC.indent-blankline = entryAnywhere '' + vim.pluginRC.indent-blankline = entryAnywhere '' require("ibl").setup(${toLuaObject cfg.indentBlankline.setupOpts}) ''; }) (mkIf cfg.cursorline.enable { vim.startPlugins = ["nvim-cursorline"]; - vim.luaConfigRC.cursorline = entryAnywhere '' + vim.pluginRC.cursorline = entryAnywhere '' require('nvim-cursorline').setup { cursorline = { timeout = ${toString cfg.cursorline.lineTimeout}, @@ -37,7 +37,7 @@ in { (mkIf cfg.scrollBar.enable { vim.startPlugins = ["scrollbar-nvim"]; - vim.luaConfigRC.scrollBar = entryAnywhere '' + vim.pluginRC.scrollBar = entryAnywhere '' require('scrollbar').setup{ excluded_filetypes = { 'prompt', @@ -56,7 +56,7 @@ in { (mkIf cfg.smoothScroll.enable { vim.startPlugins = ["cinnamon-nvim"]; - vim.luaConfigRC.smoothScroll = entryAnywhere '' + vim.pluginRC.smoothScroll = entryAnywhere '' require('cinnamon').setup() ''; }) @@ -66,7 +66,7 @@ in { vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "CellularAutomaton make_it_rain" "Make it rain"; - vim.luaConfigRC.cellularAUtomaton = entryAnywhere '' + vim.pluginRC.cellularAUtomaton = entryAnywhere '' local config = { fps = 50, name = 'slide', @@ -94,7 +94,7 @@ in { (mkIf cfg.highlight-undo.enable { vim.startPlugins = ["highlight-undo"]; - vim.luaConfigRC.highlight-undo = entryAnywhere '' + vim.pluginRC.highlight-undo = entryAnywhere '' require('highlight-undo').setup({ duration = ${toString cfg.highlight-undo.duration}, highlight_for_count = ${boolToString cfg.highlight-undo.highlightForCount}, diff --git a/modules/plugins/visuals/fidget/config.nix b/modules/plugins/visuals/fidget/config.nix index cde2f63..3ae3b6b 100644 --- a/modules/plugins/visuals/fidget/config.nix +++ b/modules/plugins/visuals/fidget/config.nix @@ -12,7 +12,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = ["fidget-nvim"]; - vim.luaConfigRC.fidget-nvim = entryAnywhere '' + vim.pluginRC.fidget-nvim = entryAnywhere '' require'fidget'.setup(${toLuaObject cfg.setupOpts}) ''; }; diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 8b28dc9..7161b6f 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -86,6 +86,18 @@ in { mapAttrsFlatten (name: value: "vim.g.${name} = ${toLuaObject value}") (filterNonNull cfg.globals); + extraPluginConfigs = resolveDag { + name = "extra plugin configs"; + dag = mapAttrs (_: value: entryAfter value.after value.setup) cfg.extraPlugins; + mapResult = result: concatLines (map mkLuarcSection result); + }; + + pluginConfigs = resolveDag { + name = "plugin configs"; + dag = cfg.pluginRC; + mapResult = result: concatLines (map mkLuarcSection result); + }; + toLuaBindings = mode: maps: map (value: '' vim.keymap.set(${toLuaObject mode}, ${toLuaObject value.key}, ${toLuaObject value.action}, ${toLuaObject value.config}) @@ -104,12 +116,6 @@ in { omap = toLuaBindings "o" config.vim.maps.operator; icmap = toLuaBindings "ic" config.vim.maps.insertCommand; - extraPluginConfigs = resolveDag { - name = "extra plugins config"; - dag = mapAttrs (_: value: entryAfter value.after value.setup) cfg.extraPlugins; - mapResult = result: concatLines (map mkLuarcSection result); - }; - maps = [ nmap imap @@ -128,6 +134,11 @@ in { vim = { luaConfigRC = { globalsScript = concatLines globalsScript; + # basic comes after globalsScript, + # but it's defined modules/neovim/init/basic.nix + pluginConfigs = entryAfter ["basic"] pluginConfigs; + extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; + mappings = entryAfter ["extraPluginConfigs"] mappings; }; builtLuaConfigRC = let @@ -145,11 +156,7 @@ in { mapResult = result: concatLines [ cfg.luaConfigPre - (concatMapStringsSep "\n" mkLuarcSection result) - extraPluginConfigs - mappings - cfg.luaConfigPost ]; }; diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index a51e74d..6b1289d 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -5,7 +5,7 @@ }: let inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.strings) optionalString; - inherit (lib.types) str oneOf attrs lines listOf either path bool; + inherit (lib.types) str attrs lines listOf either path bool; inherit (lib.nvim.types) dagOf; inherit (lib.nvim.lua) listToLuaTable; cfg = config.vim; @@ -130,6 +130,13 @@ in { ''; }; + pluginRC = mkOption { + internal = true; + type = either (dagOf lines) str; + default = {}; + description = "The internal DAG used to configure plugins"; + }; + luaConfigPre = mkOption { type = str; default = '' @@ -190,7 +197,7 @@ in { }; luaConfigRC = mkOption { - type = oneOf [(dagOf lines) str]; + type = either (dagOf lines) str; default = {}; description = '' Lua configuration, either as a string or a DAG.