// VSCODE-VIML — VS CODE SUPPORT FOR THE VIML LANGUAGE

filetype detection (*.vim + vimrc/init.vim + vim shebang) · standalone TextMate grammar (source.viml) · LSP via vimlrs --lsp · DAP via vimlrs --dap

settings vim.path / vim.lsp.enabled / vim.lsp.args · run VimL: Run File (Ctrl+F5) · debug F5

Report GitHub
// Color scheme

>_VSCODE-VIML — VIML IN VS CODE

Open a .vim file and the whole language lights up. VimL (Vimscript) is the configuration and scripting language of Vim / Neovim; vimlrs is a standalone interpreter for it written in Rust (a port of Neovim's eval engine on fusevm). vscode-viml registers the vim language for *.vim files, the vimrc / init.vim config filenames, and VimL shebangs, highlights with a standalone TextMate grammar (source.viml) covering statement keywords, ex commands, scope-sigil variables, the v: specials, built-in functions, options, registers, and strings, starts the vimlrs --lsp language server via vscode-languageclient, and debugs through vimlrs --dap.

Install

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

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

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

What you get

Filetype detection

Every *.vim file becomes the vim language. The vimrc / .vimrc / init.vim config filenames and files with a #!/usr/bin/env vimlrs shebang are detected via filenames + firstLine.

Standalone grammar

A TextMate grammar (source.viml) — statement keywords, ex commands, scope sigils, v: specials, built-in functions, options, registers, strings, numbers, operators.

Language server

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

Run

VimL: Run File (Ctrl+F5 / editor-title ▶) saves and runs the active file as vimlrs <file> in an integrated terminal.

Debugging

Breakpoints, step over/into/out, call stack, scopes, variables, watch / hover, and run-without-debugging via the native debug adapter (vimlrs --dap).

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
Statement keywords (if function let try echo)keyword.control.viml
Ex commands (set autocmd nnoremap highlight)keyword.other.command.viml
Special v: variables (v:true v:version v:val)constant.language.viml
Built-in functions (substitute printf has split)support.function.viml
Scope-sigil variables (g:foo s:bar a:000)variable.other.viml
Options (&number &l:shiftwidth)variable.other.option.viml
Environment ($HOME $PATH)variable.other.environment.viml
Registers (@a @" @+)variable.other.register.viml
Function intro (function! s:Trim)entity.name.function.viml

Strings (single-quoted literal, double-quoted with escapes), numbers (integer / float / scientific / hex), comments ("), and the operator set (assignment, comparison, is / isnot, =~ / !~, logical, arithmetic, .. concatenation, ternary) are scoped too.

Language server settings

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

The transport is omitted so the client spawns bare vimlrs --lsp and never appends --stdio. If the binary is missing, the extension shows one non-fatal warning and highlighting keeps working.

Compatibility

TargetStatus
VS Code 1.75+Grammar + LSP + DAP
VSCodium / OSS buildsSame extension
Syntax highlightingNo binary required
Language server & debugRequires vimlrs on PATH