system/neovim/snippets.nix

94 lines
2.2 KiB
Nix

{ ... }:
{
plugins.snippet.luasnip.snippetGroups = [
{
filetype = "nix";
snippets = {
"if".nodes = [
{ text = "if "; }
{ jump = 1; text = "condition"; }
{ text = " then "; }
{ jump = 2; text = "trueBody"; }
{ text = " else "; }
{ jump = 3; text = "falseBody"; }
{ jump = 0; }
];
"inherit".nodes = [
{ text = "inherit "; }
{
jump = 1;
choices = [
{
nodes = [
{ text = "("; }
{ jump = 1; text = "lib"; }
{ text = ") "; }
];
}
{ text = ""; }
];
}
{ jump = 2; text = "filter"; }
{ text = ";"; }
{ jump = 0; }
];
"var".nodes = [
{ jump = 1; text = "name"; }
{ text = " = "; }
{ jump = 2; text = "value"; }
{ text = ";"; }
{ jump = 0; }
];
"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 "; }
{ jump = 1; }
{ text = "in"; }
];
}
{
nodes = [
{ text = "with "; }
{ jump = 1; text = "lib"; }
{ text = ";"; }
];
}
{ text = ""; }
];
}
{ text = [ "" "{" "" ]; }
{
jump = 3;
nodes = [
{ text = " "; }
{ jump = 1; text = "hello"; }
];
}
{ text = [ "" "}" ]; }
{ jump = 0; }
];
};
}
];
}