Compare commits

..

No commits in common. "2b3c0cde23cca824e83cb53b067151dd1d67058e" and "fa0f962663a9c9462e8bc291b10ec309781a75fb" have entirely different histories.

6 changed files with 48 additions and 57 deletions

View file

@ -31,9 +31,6 @@ in {
vim.autocomplete.type has been removed in favor of per-plugin modules. vim.autocomplete.type has been removed in favor of per-plugin modules.
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] ''
vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip.
'')
(mkRenamedOptionModule ["vim" "lsp" "lspkind" "mode"] ["vim" "lsp" "lspkind" "setupOpts" "mode"]) (mkRenamedOptionModule ["vim" "lsp" "lspkind" "mode"] ["vim" "lsp" "lspkind" "setupOpts" "mode"])
]; ];
} }

View file

@ -12,9 +12,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["nvim-autopairs"]; startPlugins = ["nvim-autopairs"];
pluginRC.autopairs = entryAnywhere '' pluginRC.autopairs = entryAnywhere "require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})";
require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})
'';
}; };
}; };
} }

View file

@ -8,7 +8,7 @@ in {
]; ];
options.vim.autopairs.nvim-autopairs = { options.vim.autopairs.nvim-autopairs = {
enable = mkEnableOption "autopairs"; enable = mkEnableOption "autopairs" // {default = false;};
setupOpts = mkPluginSetupOption "nvim-autopairs" {}; setupOpts = mkPluginSetupOption "nvim-autopairs" {};
}; };
} }

View file

@ -14,7 +14,7 @@
cfg = config.vim.autocomplete.nvim-cmp; cfg = config.vim.autocomplete.nvim-cmp;
in { in {
options.vim.autocomplete.nvim-cmp = { options.vim.autocomplete.nvim-cmp = {
enable = mkEnableOption "nvim-cmp"; enable = mkEnableOption "nvim-cmp" // {default = false;};
setupOpts = mkPluginSetupOption "the autocomplete plugin" { setupOpts = mkPluginSetupOption "the autocomplete plugin" {
completion.completeopt = mkOption { completion.completeopt = mkOption {
type = str; type = str;

View file

@ -16,10 +16,9 @@
in { in {
config = mkMerge [ config = mkMerge [
(mkIf cfg.enable { (mkIf cfg.enable {
vim = { vim.startPlugins = ["nvim-dap"];
startPlugins = ["nvim-dap"];
pluginRC = vim.pluginRC =
{ {
# TODO customizable keymaps # TODO customizable keymaps
nvim-dap = entryAnywhere '' nvim-dap = entryAnywhere ''
@ -29,7 +28,7 @@ in {
} }
// mapAttrs (_: v: (entryAfter ["nvim-dap"] v)) cfg.sources; // mapAttrs (_: v: (entryAfter ["nvim-dap"] v)) cfg.sources;
maps.normal = mkMerge [ vim.maps.normal = mkMerge [
(mkSetLuaBinding mappings.continue "require('dap').continue") (mkSetLuaBinding mappings.continue "require('dap').continue")
(mkSetLuaBinding mappings.restart "require('dap').restart") (mkSetLuaBinding mappings.restart "require('dap').restart")
(mkSetLuaBinding mappings.terminate "require('dap').terminate") (mkSetLuaBinding mappings.terminate "require('dap').terminate")
@ -48,13 +47,11 @@ in {
(mkSetLuaBinding mappings.goUp "require('dap').up") (mkSetLuaBinding mappings.goUp "require('dap').up")
(mkSetLuaBinding mappings.goDown "require('dap').down") (mkSetLuaBinding mappings.goDown "require('dap').down")
]; ];
};
}) })
(mkIf (cfg.enable && cfg.ui.enable) { (mkIf (cfg.enable && cfg.ui.enable) {
vim = { vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
startPlugins = ["nvim-dap-ui" "nvim-nio"];
pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] ('' vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
local dapui = require("dapui") local dapui = require("dapui")
dapui.setup() dapui.setup()
'' ''
@ -69,8 +66,7 @@ in {
dapui.close() dapui.close()
end end
''); '');
maps.normal = mkSetLuaBinding mappings.toggleDapUI "require('dapui').toggle"; vim.maps.normal = mkSetLuaBinding mappings.toggleDapUI "require('dapui').toggle";
};
}) })
]; ];
} }

View file

@ -4,7 +4,7 @@
inherit (lib.nvim.types) pluginType; inherit (lib.nvim.types) pluginType;
in { in {
options.vim.snippets.luasnip = { options.vim.snippets.luasnip = {
enable = mkEnableOption "luasnip"; enable = mkEnableOption "luasnip" // {default = false;};
providers = mkOption { providers = mkOption {
type = listOf pluginType; type = listOf pluginType;
default = ["friendly-snippets"]; default = ["friendly-snippets"];
@ -12,7 +12,7 @@ in {
The snippet provider packages. The snippet provider packages.
::: {.note} ::: {.note}
These are simply appended to {option} `vim.startPlugins`. These are simply appended to `vim.startPlugins`.
::: :::
''; '';
example = literalExpression "[\"vimPlugins.vim-snippets\"]"; example = literalExpression "[\"vimPlugins.vim-snippets\"]";