system/neovim/snippets.nix

94 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"; }
2024-05-23 01:38:44 +03:00
{ jump = 0; }
2024-05-20 23:03:25 +03:00
];
2024-05-21 01:43:02 +03:00
2024-05-23 01:38:44 +03:00
"inherit".nodes = [
{ text = "inherit "; }
2024-05-21 01:43:02 +03:00
{
2024-05-23 01:38:44 +03:00
jump = 1;
2024-05-21 01:43:02 +03:00
choices = [
{
nodes = [
2024-05-23 01:38:44 +03:00
{ text = "("; }
{ jump = 1; text = "lib"; }
{ text = ") "; }
2024-05-21 01:43:02 +03:00
];
}
2024-05-23 01:38:44 +03:00
{ text = ""; }
2024-05-21 01:43:02 +03:00
];
}
2024-05-23 01:38:44 +03:00
{ jump = 2; text = "filter"; }
2024-05-21 01:43:02 +03:00
{ text = ";"; }
2024-05-23 01:38:44 +03:00
{ jump = 0; }
];
"var".nodes = [
{ jump = 1; text = "name"; }
{ text = " = "; }
{ jump = 2; text = "value"; }
{ text = ";"; }
{ jump = 0; }
2024-05-21 01:43:02 +03:00
];
"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 = [
{ text = "let "; }
2024-05-23 01:38:44 +03:00
{ jump = 1; }
2024-05-21 01:43:02 +03:00
{ text = "in"; }
];
}
{
nodes = [
{ text = "with "; }
2024-05-23 01:38:44 +03:00
{ jump = 1; text = "lib"; }
2024-05-21 01:43:02 +03:00
{ text = ";"; }
];
}
{ text = ""; }
];
}
{ text = [ "" "{" "" ]; }
{
jump = 3;
nodes = [
{ text = " "; }
{ jump = 1; text = "hello"; }
];
}
{ text = [ "" "}" ]; }
2024-05-23 01:38:44 +03:00
{ jump = 0; }
2024-05-20 23:03:25 +03:00
];
};
}
];
}