diff --git a/neovim/dev.nix b/neovim/dev.nix index 519c38e..b84dc89 100644 --- a/neovim/dev.nix +++ b/neovim/dev.nix @@ -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" ] ]; + }) + ]; + }; } diff --git a/neovim/snippets.nix b/neovim/snippets.nix index 1b6aa2c..dd416df 100644 --- a/neovim/snippets.nix +++ b/neovim/snippets.nix @@ -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; } ]; }; }