VS Code
The zamn extension highlights and folds zamn templates:
- in
.zamnfiles; - in
<template lang="zamn">in Vue components, alongside the Vue - Official extension.
code --install-extension zeokku.zamn-vscodeExpressions in {{ }}, after tag= and in the values of directives (:to, @click, #default, v-if), quoted or in brackets, are highlighted as TypeScript, and the content of script … /script and style … /style as JavaScript and CSS.
Blocks in { }, |{ } and ( ), the content of script and style, and /* */ comments fold, wherever they span lines.
The extension also registers the zamn language: // and /* */ for toggling comments, and bracket pairs. Type checking comes from vue-language-plugin-zamn, linting from eslint-plugin-vue-zamn and formatting from prettier-plugin-zamn, each through its usual extension.
Comments
| Scope | Looks like | |
|---|---|---|
// note, /* note */ | comment.block.silent.zamn | a comment: it is left out of the HTML |
//! note, /*! note */ | string.comment.buffered.block.zamn | a string: it is in the HTML, as <!-- note --> |
The second scope is the one VS Code gives buffered comments in similar languages, so themes that style those style these. To pick the colours yourself:
// settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{ "scope": "string.comment.buffered.block.zamn", "settings": { "foreground": "#c9a26d" } },
{ "scope": "comment.block.silent.zamn", "settings": { "fontStyle": "italic" } }
]
}"Toggle Line Comment" writes //, and "Toggle Block Comment" /* */, in .zamn files and inside <template lang="zamn">, so commenting a line out never puts it into the page.
Better Comments Next
Better Comments Next decorates // TODO, // ! and the like. It reads the comment markers from the language of the file:
in a
.zamnfile,//and/* */comments are decorated. Better Comments reads a!straight after the marker as its "alert" tag, so//! noteis shown as an alert;in a
.vuefile the language isvue, whose only marker is<!-- -->. The zamn extension sets a default forbetter-comments.languagesthat givesvuethe line comment//, so it works there too. If you setbetter-comments.languagesyourself, your value replaces that default, so include the entry:jsonc"better-comments.languages": [ { "id": "vue", "comments": { "lineComment": "//", "blockComment": ["<!--", "-->"] } } ]
Inspecting scopes
To see how a piece of a template is highlighted, run "Developer: Inspect Editor Tokens and Scopes".
