Overview Version History Q & A Rating & Review
Nunchucks VS Code Extension
Syntax highlighting extension for Nunchucks templates (.njk, .nunchucks) with custom tag/filter-friendly tokenization.
Links
What This Extension Does
Registers a dedicated language id: nunchucks-template
Associates file extensions:
Applies a TextMate grammar for Nunchucks syntax:
tag blocks: {% ... %}
output blocks: {{ ... }}
comments: {# ... #}
filters, operators, and common expression forms
Uses language-configuration.json for editor behaviors:
bracket/quote pairs
auto-closing
surrounding pairs
comments configuration
How It Works (Internals)
package.json
declares the language contribution and grammar contribution
syntaxes/nunchucks.tmLanguage.json
TextMate grammar rules that drive syntax scopes and colors
language-configuration.json
editing experience rules (pairs, comments, etc.)
Coloring itself is controlled by the active VS Code theme. This extension provides scopes; themes choose the final colors.
Install
Option 1: Install from local folder
Open VS Code.
Run: Developer: Install Extension from Location...
Select vscode-nunchucks.
Option 2: Install from VSIX
Build package:
In VS Code run:
Extensions: Install from VSIX...
Select the generated .vsix file.
Usage
Open an .njk file.
Confirm language mode is Nunchucks (nunchucks-template).
If needed, force association in workspace settings:
{
"files.associations": {
"*.njk": "nunchucks-template",
"*.nunchucks": "nunchucks-template"
}
}
Recommended Workspace Styling
If you want HTML tags/attributes colored differently from Nunchucks tags, keep .njk on nunchucks-template and tune editor.tokenColorCustomizations in your workspace.
Publish / Release
Bump version in vscode-nunchucks/package.json
Package:
Publish:
npx vsce login <publisher>
npx vsce publish
If publish fails with PAT permission errors, create a new Marketplace token with publisher-scoped publish permissions and re-run vsce login.
License
BSD-2-Clause. See vscode-nunchucks/LICENSE.