Skip to content

Commit

Permalink
plugins/friendly-snippets: init
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jan 22, 2024
1 parent be2ed58 commit 86d6ce5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@

./pluginmanagers/packer.nix

./snippets/friendly-snippets.nix
./snippets/luasnip

./statuslines/airline.nix
Expand Down
25 changes: 25 additions & 0 deletions plugins/snippets/friendly-snippets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.friendly-snippets;
in {
meta.maintainers = [maintainers.GaetanLepage];

options.plugins.friendly-snippets = {
enable = mkEnableOption "friendly-snippets";

package = helpers.mkPackageOption "friendly-snippets" pkgs.vimPlugins.friendly-snippets;
};

config = mkIf cfg.enable {
extraPlugins = [cfg.package];

# Simply add an element to the `fromVscode` list to trigger the import of friendly-snippets
plugins.luasnip.fromVscode = [{}];
};
}
8 changes: 8 additions & 0 deletions tests/test-sources/plugins/snippets/friendly-snippets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
empty = {
plugins = {
luasnip.enable = true;
friendly-snippets.enable = true;
};
};
}

0 comments on commit 86d6ce5

Please sign in to comment.