Vim Recall繁體中文

Load Vim or Ex commands from a file

:source

Example

Normal 0 / 2

Load Vim or Ex commands from a file.

Variables

g:accent
unset
Before & after

Before

Variables

g:accent
unset

After

Variables

g:accent
blue

Subject: :source. Documentation-backed illustration; assumes +eval, readable trusted fixture colors.vim with the displayed contents; not replay-verified. Reads and executes the commands in the prepared colors.vim; the assignment creates g:accent with blue.

Sample buffer
notes
Cursor on line 1, column 1
Details & Vim help

Load Vim or Ex commands from a 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 :so[urce] 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.