diff --git a/flake.lock b/flake.lock index f47453d..1cfb15d 100644 --- a/flake.lock +++ b/flake.lock @@ -324,6 +324,24 @@ "type": "github" } }, + "flake-utils_7": { + "inputs": { + "systems": "systems_8" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "glaurung": { "inputs": { "flake-utils": "flake-utils_2", @@ -735,6 +753,21 @@ } }, "nixpkgs_13": { + "locked": { + "lastModified": 1768756095, + "narHash": "sha256-oyzGWvIdnU+qXBn5pgtLozyZEZMqxrMqyGtHVELwY3s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f621f1f21a27200b249df16dd8e99d17337060cd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_14": { "locked": { "lastModified": 1767364772, "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", @@ -963,6 +996,7 @@ "raclette": "raclette", "rust-overlay": "rust-overlay_4", "simulationcraft": "simulationcraft", + "tree-sitter-vvk": "tree-sitter-vvk", "treefmt-nix": "treefmt-nix", "vim-headerguard": "vim-headerguard", "wayland-pipewire-idle-inhibit": "wayland-pipewire-idle-inhibit" @@ -1199,6 +1233,21 @@ } }, "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1213,9 +1262,28 @@ "type": "github" } }, + "tree-sitter-vvk": { + "inputs": { + "flake-utils": "flake-utils_7", + "nixpkgs": "nixpkgs_13" + }, + "locked": { + "lastModified": 1768772541, + "narHash": "sha256-udlc/UQtPo8GwJcdBAV3JGw4no0r42ISMN6eMS40z5M=", + "ref": "refs/heads/master", + "rev": "29710a61d71c9fd763c87aa94c5ee7d832c60e09", + "revCount": 5, + "type": "git", + "url": "https://forgejo.familleboyer.net/traxys/tree-sitter-vvk" + }, + "original": { + "type": "git", + "url": "https://forgejo.familleboyer.net/traxys/tree-sitter-vvk" + } + }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1768158989, @@ -1274,7 +1342,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_8", + "systems": "systems_9", "treefmt-nix": "treefmt-nix_2" }, "locked": { diff --git a/flake.nix b/flake.nix index 1e22140..d223b8d 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ url = "github:drmikehenry/vim-headerguard"; flake = false; }; + tree-sitter-vvk.url = "git+https://forgejo.familleboyer.net/traxys/tree-sitter-vvk"; }; outputs = diff --git a/neovim/config/default.nix b/neovim/config/default.nix index dac8f45..d218f30 100644 --- a/neovim/config/default.nix +++ b/neovim/config/default.nix @@ -1,4 +1,4 @@ -{ flake }: +{ flake, tree-sitter-vvk }: { pkgs, config, @@ -140,6 +140,7 @@ }; extension = { lalrpop = "lalrpop"; + vvk = "vvk"; }; }; @@ -235,6 +236,34 @@ (#set! injection.language "javascript")) ''; + extraFiles."queries/vvk//highlights.scm".text = '' + (comment) @comment + + [ + "[" + "]" + "{" + "}" + ] @punctuation.bracket + + [ + "mod" + ] @keyword.import + + (directive) @keyword.modifier + + (string_literal) @string + + (target + name: (identifier) @function.call) + + (assign_statement + name: (identifier) @variable) + + (argument + name: (identifier) @variable.member) + ''; + plugins.treesitter = { enable = true; @@ -245,57 +274,68 @@ nixvimInjections = true; - grammarPackages = with config.plugins.treesitter.package.passthru.builtGrammars; [ - arduino - asm - bash - bitbake - c - cpp - cuda - dart - devicetree - diff - dockerfile - editorconfig - fish - gitattributes - gitcommit - gitignore - git_rebase - groovy - html - ini - javascript - json - just - lalrpop - latex - linkerscript - lua - make - markdown - markdown_inline - mermaid - meson - ninja - nix - printf - python - regex - rst - rust - slint - sql - tlaplus - toml - typst - vim - vimdoc - xml - yaml - zig - ]; + grammarPackages = + let + ts = config.plugins.treesitter.package.passthru; + in + [ + (pkgs.tree-sitter.buildGrammar { + language = "vvk"; + version = tree-sitter-vvk.rev; + src = tree-sitter-vvk; + }) + ] + ++ (with ts.builtGrammars; [ + arduino + asm + bash + bitbake + c + cpp + cuda + dart + devicetree + diff + dockerfile + editorconfig + fish + gitattributes + gitcommit + gitignore + git_rebase + groovy + html + ini + javascript + json + just + lalrpop + latex + linkerscript + lua + make + markdown + markdown_inline + mermaid + meson + ninja + nix + printf + python + regex + rst + rust + slint + sql + tlaplus + toml + typst + vim + vimdoc + xml + yaml + zig + ]); }; plugins.treesitter-context = { diff --git a/neovim/default.nix b/neovim/default.nix index 54f6615..90af300 100644 --- a/neovim/default.nix +++ b/neovim/default.nix @@ -10,7 +10,10 @@ }; flake.nixvimModules = { - config = import ./config { flake = self; }; + config = import ./config { + flake = self; + inherit (inputs) tree-sitter-vvk; + }; plugins = import ./plugins { inherit (inputs) vim-headerguard; };