system/neovim/snippets.nix

95 lines
2.2 KiB
Nix
Raw Normal View History

2024-05-20 23:03:25 +03:00
{ ... }:
{
plugins.snippet.luasnip.snippetGroups = [
{
filetype = "nix";
snippets = {
"if".nodes = [
2024-05-21 01:43:02 +03:00
{ text = "if "; }
{ jump = 1; text = "condition"; }
{ text = " then "; }
{ jump = 2; text = "trueBody"; }
{ text = " else "; }
{ jump = 3; text = "falseBody"; }
{ text = ";"; }
2024-05-20 23:03:25 +03:00
];
2024-05-21 01:43:02 +03:00
2024-05-20 23:03:25 +03:00
"var".nodes = [
2024-05-21 01:43:02 +03:00
{ jump = 1; text = "name"; }
{ text = " = "; }
{
jump = 2;
choices = [
{ kind = "insert"; text = "value"; }
{
nodes = [
{ jump = 1; }
{ text = "["; }
{ jump = 2; }
{ text = "]"; }
];
}
{
nodes = [
{ jump = 1; }
{ text = "{"; }
{ jump = 2; }
{ text = "}"; }
];
}
];
}
{ text = ";"; }
];
"module".nodes = [
{ text = "{ "; }
{
jump = 1;
choices = [
{ kind = "insert"; text = "pkgs, "; }
{ text = "config, "; }
{ text = "config, lib, "; }
{ text = "config, lib, pkgs, "; }
];
}
{ text = "..."; }
{ text = [ " }:" "" ]; }
{
jump = 2;
choices = [
{
nodes = [
{ jump = 1; }
{ text = "let "; }
{ jump = 2; }
{ text = "in"; }
];
}
{
nodes = [
{ jump = 1; }
{ text = "with "; }
{ jump = 2; text = "lib"; }
{ text = ";"; }
];
}
{ text = ""; }
];
}
{ text = [ "" "{" "" ]; }
{
jump = 3;
nodes = [
{ text = " "; }
{ jump = 1; text = "hello"; }
];
}
{ text = [ "" "}" ]; }
2024-05-20 23:03:25 +03:00
];
};
}
];
}