Vimscript

Vimscript, sometimes written VimL, is the scripting and configuration language built into the Vim text editor. It is the language of the user’s vimrc file and of Vim plugins, used to set options, define key mappings, write functions, and automate editing tasks. Its expression and statement syntax is documented in Vim’s own help under :help eval, mirrored online in the eval.txt help file, which serves as the authoritative reference for the language.

The language is dynamically typed with a set of built-in data types described in that documentation. These include Numbers, defined as “A 32 or 64 bit signed number”; Floats; and Strings, “A NUL terminated string of 8-bit unsigned characters (bytes).” It also provides collection types: Lists, “An ordered sequence of items”; Dictionaries, “An associative, unordered array: Each entry has a key and a value”; immutable Tuples; and Blobs, a “Binary Large Object” that “Stores any sequence of bytes.” Function references (Funcref), Job and Channel handles for asynchronous work, and special values such as v:true, v:false, and v:null round out the type system.

A notable quirk that the documentation makes explicit is automatic coercion between numbers and strings: “The Number and String types are converted automatically, depending on how they are used.” Number-to-string conversion produces an ASCII representation, while string-to-number conversion reads the leading digits. The language also defines a full operator precedence table running from the ternary conditional ?: through logical || and && and the comparison and arithmetic operators down to postfix indexing and method calls, giving Vimscript a conventional expression grammar despite its editor-centric origins.

Vimscript grew organically alongside Vim over decades, which gave it considerable power but also a reputation for idiosyncrasy and slow execution. That history motivated the Neovim project to add Lua as a first-class alternative for configuration and plugins, while still committing not to deprecate Vimscript so that the enormous body of existing scripts continues to run. Vimscript therefore remains central to the Vim ecosystem, both as the language in which most legacy plugins are written and as the configuration glue that ties Vim’s modal editing features together.

Sources

Last verified June 8, 2026