Compare commits

...

5 commits

Author SHA1 Message Date
diniamo
2b3c0cde23 nvim-dap: use outer attribute 2024-10-09 00:10:34 +02:00
diniamo
630b8ffe51 nvim-autopairs: use multiline string 2024-10-08 23:02:30 +02:00
diniamo
1ebc002042 deprecations: add entry for vsnip 2024-10-08 22:57:46 +02:00
diniamo
ebda97a032 luasnip: add missing {option} for option reference 2024-10-08 22:55:38 +02:00
diniamo
6921ac4e4e treewide: remove reduant // {default = false;}s 2024-10-08 22:54:50 +02:00
6 changed files with 57 additions and 48 deletions

View file

@ -31,6 +31,9 @@ in {
vim.autocomplete.type has been removed in favor of per-plugin modules.
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"])
];
}

View file

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

View file

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

View file

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

View file

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

View file

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