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 let
inherit (lib.mod) ctrl; inherit (lib.mod) ctrl;
inherit (lib.nix2lua) pipe1 require call call0; inherit (lib.nix2lua) pipe1 require call call0 nf var;
mkLineLimiterGroup = { limit, pattern }: mkLineLimiterGroup = { limit, pattern }:
lib.nameValuePair lib.nameValuePair
@ -149,4 +149,15 @@ in
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ]; 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"; } { jump = 2; text = "trueBody"; }
{ text = " else "; } { text = " else "; }
{ jump = 3; text = "falseBody"; } { 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 = ";"; } { text = ";"; }
{ jump = 0; }
]; ];
"var".nodes = [ "var".nodes = [
{ jump = 1; text = "name"; } { jump = 1; text = "name"; }
{ text = " = "; } { text = " = "; }
{ { jump = 2; text = "value"; }
jump = 2;
choices = [
{ kind = "insert"; text = "value"; }
{
nodes = [
{ jump = 1; }
{ text = "["; }
{ jump = 2; }
{ text = "]"; }
];
}
{
nodes = [
{ jump = 1; }
{ text = "{"; }
{ jump = 2; }
{ text = "}"; }
];
}
];
}
{ text = ";"; } { text = ";"; }
{ jump = 0; }
]; ];
"module".nodes = [ "module".nodes = [
@ -61,17 +61,15 @@
choices = [ choices = [
{ {
nodes = [ nodes = [
{ jump = 1; }
{ text = "let "; } { text = "let "; }
{ jump = 2; } { jump = 1; }
{ text = "in"; } { text = "in"; }
]; ];
} }
{ {
nodes = [ nodes = [
{ jump = 1; }
{ text = "with "; } { text = "with "; }
{ jump = 2; text = "lib"; } { jump = 1; text = "lib"; }
{ text = ";"; } { text = ";"; }
]; ];
} }
@ -87,6 +85,7 @@
]; ];
} }
{ text = [ "" "}" ]; } { text = [ "" "}" ]; }
{ jump = 0; }
]; ];
}; };
} }