Indicates Vim9 script file
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Indicates Vim9 script file.
Prepared example.vim
- Status
not sourced
Vim messages
Empty
Command entered · ready to apply
Prepared example.vim
- Status
not sourced
Vim messages
Empty
The first command marks this file as Vim9 script, enabling var and Vim9 expression syntax for the following lines.
Prepared example.vim
- Status
sourced- Script language
Vim9- greeting
Hello; script local
Vim messages
Hello
Before & after
Before
Prepared example.vim
- Status
not sourced
Vim messages
Empty
After
Prepared example.vim
- Status
sourced- Script language
Vim9- greeting
Hello; script local
Vim messages
Hello
Subject: :vim9script. Documentation-backed illustration; assumes Vim9 script support; vim9script is the first command; current unmodified buffer is saved as example.vim; not replay-verified. The first command marks this file as Vim9 script, enabling var and Vim9 expression syntax for the following lines.
vim9script
var greeting = 'Hello'
echo greetingCursor on line 1, column 1Details & Vim help
Indicates Vim9 script file. 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 :vim9s[cript] 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. Vim9 script constructs require the documented Vim9 script context.