Load view for current window from a file
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2alpha
beta
gammaCursor on line 1, column 1alpha
beta
gammaCursor on line 1, column 1alpha
beta
gammaCursor on line 3, column 1Load 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
Command entered · ready to apply
View state
- Current cursor
line 1- Saved view 1
notes.txt, cursor line 3- Current file
notes.txt
Command line
- Typed text
:loadview 1- Insertion offset
11
:loadview 1 restores the view previously saved with :mkview 1 for this same notes.txt.
View state
- Current cursor
line 3- Saved view 1
notes.txt, cursor line 3- Current file
notes.txt
Before & after
alpha
beta
gammaCursor on line 1, column 1View state
- Current cursor
line 1- Saved view 1
notes.txt, cursor line 3- Current file
notes.txt
alpha
beta
gammaCursor on line 3, column 1View 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.