Version of Vim script used
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Version of Vim script used.
Prepared example.vim
- Status
not sourced
Vim messages
Empty
Command entered · ready to apply
Prepared example.vim
- Status
not sourced
Vim messages
Empty
At the top level of a sourced legacy script, scriptversion 4 selects version-4 semantics for subsequent lines; .. concatenates red and blue.
Prepared example.vim
- Status
sourced- Legacy script version
4- g:joined
redblue
Vim messages
redblue
Before & after
Before
Prepared example.vim
- Status
not sourced
Vim messages
Empty
After
Prepared example.vim
- Status
sourced- Legacy script version
4- g:joined
redblue
Vim messages
redblue
Subject: :scriptversion. Documentation-backed illustration; assumes +eval and support for legacy script version 4; current unmodified buffer is saved as example.vim; not replay-verified. At the top level of a sourced legacy script, scriptversion 4 selects version-4 semantics for subsequent lines; .. concatenates red and blue.
scriptversion 4
let g:joined = 'red' .. 'blue'
echo g:joinedCursor on line 1, column 1Details & Vim help
Version of Vim script used. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :scriptv[ersion] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.