Vim Recall繁體中文

Load view for current window from a file

:loadview

Example

Normal 0 / 2
alpha
beta
gamma
Cursor on line 1, column 1

Load view for current window from a file.

View state

Current cursor
line 1
Saved view 1
notes.txt, cursor line 3
Current file
notes.txt
Before & after
Before
alpha
beta
gamma
Cursor on line 1, column 1

View state

Current cursor
line 1
Saved view 1
notes.txt, cursor line 3
Current file
notes.txt
After
alpha
beta
gamma
Cursor on line 3, column 1

View state

Current cursor
line 3
Saved view 1
notes.txt, cursor line 3
Current file
notes.txt

Documentation-backed illustration. +mksession support; viewdir contains a valid view 1 generated for this exact notes.txt path, with cursor line 3. :loadview 1 restores the view previously saved with :mkview 1 for this same notes.txt. Primary help: :loadview.

Details & Vim help

Load view for current window 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 :lo[adview] 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.