// VIM-ZSH — VIM / NEOVIM SUPPORT FOR ZSHRS

filetype detection (zsh files + dotfiles + zsh shebang) · standalone zshrs grammar (generated; 137 builtins, 113 extensions, 245 special vars) · shell-block indent · ALE lint via zshrs -n · vim-lsp / coc via zshrs --lsp

pathogen / vim-plug / native packages · zero config · opt-outs g:vim_zsh_no_ale, g:vim_zsh_no_lsp

Report GitHub Issues
// Color scheme

>_VIM-ZSH — ZSHRS IN VIM AND NEOVIM

Load it with pathogen, get full zshrs support in Vim / Neovim. zshrs is the Rust rewrite of zsh — the first compiled Unix shell. vim-zsh registers the zshrs filetype for zsh files, dotfiles, and zsh shebangs, highlights with a standalone zshrs grammar generated from zshrs --dump-reflection (137 builtins, 113 extensions, 245 special vars, 24+10 keywords), indents with a shell-block-aware indenter, wires up zshrs -n as an ALE linter, and registers zshrs --lsp for vim-lsp and coc.nvim. The filetype is zshrs (not zsh), so Vim's bundled zsh highlighter is never clobbered.

Install

The zshrs binary must be on $PATH for linting and LSP (build zshrs). Then drop the plugin into your runtimepath:

# pathogen
cd ~/.vim/bundle
git clone https://github.com/MenkeTechnologies/vim-zsh
# then, inside vim:  :Helptags

# vim-plug (add to ~/.vimrc / init.vim)
Plug 'MenkeTechnologies/vim-zsh'

# native packages (Vim 8+ / Neovim)
git clone https://github.com/MenkeTechnologies/vim-zsh \
    ~/.vim/pack/plugins/start/vim-zsh

Open any .zsh file and it lights up — no further configuration. Help: :help vim-zsh.

What you get

Filetype detection

zsh files (*.zsh …), dotfiles (.zshrc …), and extensionless scripts with a #!/usr/bin/env zsh shebang all become filetype=zshrs.

Syntax highlighting

A standalone zshrs grammar — 137 builtins, 113 extensions, 245 special vars, keywords, sigil variables, strings, here-docs, and command substitution — generated from zshrs --dump-reflection, not a perl / zsh reskin.

Indentation

A standalone shell-block-aware indenter — indents after a line that opens a block / paren / bracket or a do / then / in, dedents done / fi / esac / closing delimiters.

Linting (ALE)

Runs zshrs -n over the buffer and surfaces zsh: parse error … diagnostics inline. Skips silently if ALE is absent.

Language server

Registers zshrs --lsp for vim-lsp, allowlisted for zshrs + zsh. coc.nvim snippet in the README.

Zero config

No settings required. Two opt-outs: g:vim_zsh_no_ale and g:vim_zsh_no_lsp to skip either integration.

Token categories

The grammar is generated from the zshrs binary's own reflection tables (zshrs --dump-reflection) — the .builtins, .extensions, and .special_vars tables — plus the static shell keyword grammar:

GroupTokens (sample)
Declarations (10)declare export float integer let local readonly set shift typeset
Control flow (24)if elif else fi for foreach while until do done case esac function select repeat return
Builtins (137)bindkey cd echo print read setopt unsetopt zmodload zle zstyle autoload bg fg jobs
Extensions (113)async await barrier arch base64 fold — zshrs-specific, own highlight
Special variables (245)PATH HOME PWD ZSH_VERSION RANDOM LINENO SECONDS HISTFILE
Sigil variables$name ${...} $1 $# $@ $? $! $$ $* $-

Single / double quoted strings with $var / ${...} interpolation and escapes, backtick and $(...) command substitution, here-docs (<<EOF / <<- / <<'EOF'), numbers, comments, and the shebang are handled too. Everything links to standard highlight groups, so every colorscheme covers it without bespoke tuning.

Layout

vim-zsh/
├── ftdetect/zshrs.vim   # *.zsh + dotfiles + zsh shebang -> filetype=zshrs
├── syntax/zshrs.vim     # standalone zshrs grammar (generated; 137 builtins, 113 extensions, 245 special vars)
├── ftplugin/zshrs.vim   # commentstring '# %s', comments, formatoptions
├── indent/zshrs.vim     # standalone shell-block-aware indenter
├── plugin/zshrs.vim     # ALE linter + vim-lsp + coc wiring
└── doc/zshrs.txt        # :help vim-zsh

Standard Vim runtime layout, so pathogen / vim-plug / native packages add it to runtimepath with no special handling. Licensed MIT.

Compatibility

Editor / pluginStatus
Vim 8+Filetype, syntax, indent, ftplugin
NeovimSame runtime files
ALEzshrs -n linter
vim-lspzshrs --lsp server
coc.nvimlanguageserver config in README