Vim Recall繁體中文

Version of Vim script used

:scriptversion

Example

Normal 0 / 2

Version of Vim script used.

Prepared example.vim

Status
not sourced

Vim messages

Empty
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.

Sample buffer
scriptversion 4
let g:joined = 'red' .. 'blue'
echo g:joined
Cursor on line 1, column 1
Details & 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.