neovim: add more nix snippets

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-23 01:38:44 +03:00
parent 59129e97b9
commit db3d26e687
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
2 changed files with 37 additions and 27 deletions

View file

@ -2,7 +2,7 @@
let
inherit (lib.mod) ctrl;
inherit (lib.nix2lua) pipe1 require call call0;
inherit (lib.nix2lua) pipe1 require call call0 nf var;
mkLineLimiterGroup = { limit, pattern }:
lib.nameValuePair
@ -149,4 +149,15 @@ in
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
};
};
plugins.snippet.luasnip.settings = {
ext_opts = [
(nf (var "luasnip_types.choiceNode") {
active.virt_text = [ [ "" "WarningMsg" ] ];
})
(nf (var "luasnip_types.insertNode") {
active.virt_text = [ [ "" "Title" ] ];
})
];
};
}

View file

@ -12,35 +12,35 @@
{ 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;
choices = [
{ kind = "insert"; text = "value"; }
{
nodes = [
{ jump = 1; }
{ text = "["; }
{ jump = 2; }
{ text = "]"; }
];
}
{
nodes = [
{ jump = 1; }
{ text = "{"; }
{ jump = 2; }
{ text = "}"; }
];
}
];
}
{ jump = 2; text = "value"; }
{ text = ";"; }
{ jump = 0; }
];
"module".nodes = [
@ -61,17 +61,15 @@
choices = [
{
nodes = [
{ jump = 1; }
{ text = "let "; }
{ jump = 2; }
{ jump = 1; }
{ text = "in"; }
];
}
{
nodes = [
{ jump = 1; }
{ text = "with "; }
{ jump = 2; text = "lib"; }
{ jump = 1; text = "lib"; }
{ text = ";"; }
];
}
@ -87,6 +85,7 @@
];
}
{ text = [ "" "}" ]; }
{ jump = 0; }
];
};
}