2024-10-09 17:50:34 +00:00
|
|
|
{lib, ...}: let
|
|
|
|
inherit (lib.options) mkEnableOption mkOption literalExpression literalMD;
|
|
|
|
inherit (lib.types) listOf lines;
|
2025-01-11 13:02:21 +00:00
|
|
|
inherit (lib.nvim.types) pluginType mkPluginSetupOption;
|
2024-10-09 17:50:34 +00:00
|
|
|
in {
|
|
|
|
options.vim.snippets.luasnip = {
|
|
|
|
enable = mkEnableOption "luasnip";
|
|
|
|
providers = mkOption {
|
|
|
|
type = listOf pluginType;
|
|
|
|
default = ["friendly-snippets"];
|
|
|
|
description = ''
|
|
|
|
The snippet provider packages.
|
|
|
|
|
|
|
|
::: {.note}
|
|
|
|
These are simply appended to {option} `vim.startPlugins`.
|
|
|
|
:::
|
|
|
|
'';
|
|
|
|
example = literalExpression "[\"vimPlugins.vim-snippets\"]";
|
|
|
|
};
|
|
|
|
loaders = mkOption {
|
|
|
|
type = lines;
|
|
|
|
default = "require('luasnip.loaders.from_vscode').lazy_load()";
|
|
|
|
defaultText = literalMD ''
|
|
|
|
```lua
|
|
|
|
require('luasnip.loaders.from_vscode').lazy_load()
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
description = "Lua code used to load snippet providers.";
|
|
|
|
example = literalMD ''
|
|
|
|
```lua
|
|
|
|
require("luasnip.loaders.from_snipmate").lazy_load()
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
};
|
2025-01-11 13:02:21 +00:00
|
|
|
|
|
|
|
setupOpts = mkPluginSetupOption "LuaSnip" {};
|
2024-10-09 17:50:34 +00:00
|
|
|
};
|
|
|
|
}
|