// VSCODE-ZSH — VS CODE SUPPORT FOR THE ZSHRS SHELL

filetype detection (zsh dotfiles + *.zsh + zsh shebang) · standalone TextMate grammar generated from the zshrs binary (137 builtins, 113 extensions, 245 special vars) · LSP via zshrs --lsp

scopeName source.zshrs · vscode-languageclient · settings zshrs.path / zshrs.lsp.enabled / zshrs.lsp.args

Report GitHub
// Color scheme

>_VSCODE-ZSH — ZSHRS IN VS CODE

Open a .zshrc and the whole shell lights up. zshrs is the first-ever Rust rewrite of zsh — a compiled, JIT'd, massively parallel shell. vscode-zsh registers the zshrs language for zsh dotfiles, *.zsh files, and zsh shebangs, highlights with a standalone TextMate grammar generated from the zshrs binary's own reflection tables (137 builtins, 113 extensions, 245 special variables), and starts the zshrs --lsp language server via vscode-languageclient.

Install

The zshrs binary must be on $PATH for the language server (build zshrs with cargo build). Build and install the .vsix locally:

git clone https://github.com/MenkeTechnologies/vscode-zsh
cd vscode-zsh
npm install
npx @vscode/vsce package          # vscode-zsh-<version>.vsix
code --install-extension vscode-zsh-*.vsix

Or clone straight into your extensions dir for development: ~/.vscode/extensions/vscode-zsh.

What you get

Filetype detection

Zsh dotfiles (.zshrc, .zshenv, .zprofile, …), *.zsh / *.zsh-theme files, and files with a #!/usr/bin/env zsh shebang (via firstLine) become the zshrs language.

Own language grammar

A standalone TextMate grammar (source.zshrs) with its own language id — 137 builtins, 113 extensions, 245 special vars, not a shellscript reskin.

Generated from the binary

scripts/gen_grammar.sh dumps zshrs --dump-reflection (.builtins / .extensions / .special_vars), so the grammar never drifts from the shell.

Language server

Launches zshrs --lsp (stdio JSON-RPC) through vscode-languageclient — diagnostics, hover, completion as the server provides.

Editor config

Comments, brackets, auto-closing pairs, and brace-based indentation via language-configuration.json.

Verified

A vscode-textmate + vscode-oniguruma test tokenizes a sample and asserts the scopes, so the grammar is proven to load and classify correctly.

Scopes

Token groupScope
Control flow (if then fi for while case function)keyword.control.zshrs
Declarations (typeset local export declare readonly integer)storage.modifier.zshrs
Builtins (137)support.function.builtin.zshrs
Extensions (113 — zshrs world-first additions)support.function.extension.zshrs
Special variables (245)variable.language.zshrs
Sigil variables ($foo ${bar} $1 $? $@ $#)variable.other.zshrs
Operators / pipes / redirects (| || && > >> <<)keyword.operator.zshrs

Strings (single / double / backtick), here-docs (<<EOF / <<- / <<'EOF'), $var / ${...} interpolation, escapes, command substitution $(...), and numbers are scoped too.

Language server settings

SettingDefault & effect
zshrs.pathzshrs — path to the executable
zshrs.lsp.enabledtrue — start the server; set false for highlighting only
zshrs.lsp.args["--lsp"] — args to start the server

If the binary is missing, the extension shows one non-fatal warning and highlighting keeps working.

Compatibility

TargetStatus
VS Code 1.75+Grammar + LSP
VSCodium / OSS buildsSame extension
Syntax highlightingNo binary required
Language serverRequires zshrs on PATH