Syntax highlighting for SaltStack .sls files in the Zed editor.
Highlights YAML structure, Salt module calls, Jinja2 templates, and more — all in a single file type.
syntax hightlight example:
| Element | Example | Color |
|---|---|---|
| State ID | gitea_user: |
red/salmon |
| Salt module | file.managed: |
yellow |
| Property key | name:, uid:, mode: |
teal/blue |
| String value | gitea, /bin/bash |
green |
| Number | 2978, 644 |
orange |
| Boolean | True, False |
orange |
| Jinja expression | {{ slspath }} |
cyan |
| Jinja block | {% if %}, {% for %} |
purple |
| Jinja comment | {# comment #} |
gray |
- Open Zed
- Press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Linux/Windows) to open Extensions - Search for SaltStack Jinja
- Click Install
Done — any .sls file you open will automatically use the SaltStack Jinja syntax.
Step 1 — Download the extension
Download and unzip zed-saltstack-jinja.zip, or clone the repository:
git clone https://github.com/yourusername/zed-saltstack-jinjaStep 2 — Install as a dev extension in Zed
- Open Zed
- Press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Linux/Windows) - Click Install Dev Extension
- Select the
zed-saltstack-jinjafolder - Zed will compile the extension automatically (requires an internet connection the first time)
Step 3 — Open a .sls file
Open any SaltStack state file. Zed will automatically detect the .sls extension and apply the SaltStack Jinja syntax. You can also manually select the language by clicking the language name in the bottom-right corner of the editor and choosing SaltStack Jinja.
| Extension | Description |
|---|---|
.sls |
SaltStack state and pillar files |
.jinja |
Standalone Jinja2 templates |
.jinja2 |
Standalone Jinja2 templates |
.j2 |
Jinja2 shorthand |
{% set mode = salt['pillar.get']('app:mode', 'production') %}
gitea_user:
user.present:
- name: gitea
- uid: 2978
- shell: /bin/bash
gitea_service:
file.managed:
- source: salt://{{ slspath }}/files/gitea.service
- template: jinja
- user: gitea
- mode: "0640"
{% if mode == 'production' %}
gitea_enabled:
service.running:
- name: gitea
- enable: True
{% endif %}The extension installs but .sls files show no highlighting
Clear the extension cache and reinstall:
# macOS
rm -rf ~/Library/Application\ Support/Zed/extensions/installed/saltstack-jinja
# Linux
rm -rf ~/.local/share/zed/extensions/installed/saltstack-jinjaThen uninstall and reinstall the extension in Zed.
The language doesn't appear in the language picker
Check Zed's log for errors: open the Command Palette (Cmd+Shift+P) and search for zed: open log. Look for any lines mentioning saltstack or jinja2.
MIT
