TextMate Grammar (tmLanguage)
The Silk compiler repository ships a TextMate grammar for Silk under textmate/silk.tmLanguage.json. It provides syntax
highlighting for editors that consume tmLanguage grammars (TextMate, VS Code, Sublime Text, Nova, and others).
Scope and File Extension#
- Scope:
source.silk - File extensions:
.slkand.silk(including build modules likebuild.slk)
TextMate (macOS)#
- Copy
textmate/silk.tmLanguage.jsonto:
~/Library/Application Support/TextMate/Bundles/Silk.tmbundle/Syntaxes/silk.tmLanguage.json
- Restart TextMate.
- Open an
.slk(or.silk) file and confirm it is recognized asSilk.
Example setup:
mkdir -p ~/Library/Application\ Support/TextMate/Bundles/Silk.tmbundle/Syntaxes
cp textmate/silk.tmLanguage.json \
~/Library/Application\ Support/TextMate/Bundles/Silk.tmbundle/Syntaxes/silk.tmLanguage.json
VS Code#
A grammar-only VS Code extension is included under textmate/vscode/. To try it, open that directory in VS Code and press F5 to launch an Extension Development Host.
Minimal local workflow:
cd textmate/vscode
code .
For LSP-backed features (diagnostics, hover, go-to-definition), use the silk-lsp language server with an appropriate
client (see LSP protocol and server and Vim integration).
Source repository · Edit this page · View Markdown