From d4f326bfd948a860c22766e732be7dbb0422b52c Mon Sep 17 00:00:00 2001 From: Daniel Fainberg Date: Tue, 15 Sep 2026 12:53:54 +0200 Subject: [PATCH] feat(nvim): highlight mustache templates nvim detects `.mustache` but ships no syntax for it, leaving Moodle templates as plain text. `vim-mustache-handlebars` supplies syntax, indent and ftdetect, covering the constructs the Handlebars tree-sitter grammar rejects: bare sections, `{{{unescaped}}}`, partials and `{{< parent }}` inheritance. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015D4NsszUG7hy9ghKZ4nfhm --- modules/nvim.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/nvim.nix b/modules/nvim.nix index 1fbdaa0..391fbc4 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -248,6 +248,17 @@ in }; }; + # Moodle/Mustache templates. nvim detects `.mustache` as filetype mustache + # but ships no syntax file for it, so the buffer renders as plain text. + # Tree-sitter is not an option here: the Handlebars grammar (glimmer) + # rejects mustache's argument-less sections, `{{{unescaped}}}`, partials + # and Moodle's `{{< parent }}` inheritance, and a single error node drops + # highlighting for the rest of the file. This plugin carries the syntax, + # indent and ftdetect scripts. nixpkgs marks it unfree only because + # upstream ships no license metadata; `allowUnfree` in modules/nixos.nix + # already covers it. + extraPlugins = [ pkgs.vimPlugins.vim-mustache-handlebars ]; + # Global (non-LSP) keymaps. Deliberately small — a starting point to grow. keymaps = [ { mode = "n"; key = "w"; action = "w"; options.desc = "Save"; }