Skip to content

Commit

Permalink
plugins/luasnip: rename extraConfig to settings (more consistent with…
Browse files Browse the repository at this point in the history
… RFC-42)
  • Loading branch information
GaetanLepage committed Aug 5, 2024
1 parent 6f7cf23 commit 25da122
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions plugins/snippets/luasnip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,32 @@ let
};
in
{
imports =
let
basePluginPath = [
"plugins"
"luasnip"
];
in
[
# TODO introduced 2024-08-04. Remove after 24.11
(lib.mkRenamedOptionModule (basePluginPath ++ [ "extraConfig" ]) (basePluginPath ++ [ "settings" ]))
];

options.plugins.luasnip = {
enable = mkEnableOption "luasnip";

package = helpers.mkPluginPackageOption "luasnip" pkgs.vimPlugins.luasnip;

extraConfig = mkOption {
type = types.attrsOf types.anything;
settings = mkOption {
type = with types; attrsOf anything;
description = ''
Extra config options for luasnip.
Example:
{
enable_autosnippets = true,
store_selection_keys = "<Tab>",
}
Options provided to the `require('luasnip').config.setup()` function.",
'';
example = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
default = { };
};

Expand Down Expand Up @@ -156,7 +166,7 @@ in
];
extraConfig = [
''
require("luasnip").config.set_config(${helpers.toLuaObject cfg.extraConfig})
require("luasnip").config.setup(${helpers.toLuaObject cfg.settings})
''
];
in
Expand Down

0 comments on commit 25da122

Please sign in to comment.