Vim Recall繁體中文

Indicates Vim9 script file

:vim9script

Example

Normal 0 / 2

Indicates Vim9 script file.

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

Sample buffer
vim9script
var greeting = 'Hello'
echo greeting
Cursor on line 1, column 1
Details & 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.