Vim Recall繁體中文

Save session info to a file

:mksession

Example

Normal 0 / 2

Save session info to a file.

Prepared workspace

Options
number enabled
Global mapping
<F6> → :set number!<CR>

Output file

ExampleSession.vim
absent
Before & after

Before

Prepared workspace

Options
number enabled
Global mapping
<F6> → :set number!<CR>

Output file

ExampleSession.vim
absent

After

Prepared workspace

Options
number enabled
Global mapping
<F6> → :set number!<CR>

Session script written

Filename
ExampleSession.vim
Meaningful contents
edit alpha.txt; split beta.txt; restore alpha.txt focus; restore number and global <F6> mapping
Representation
summary; generated script includes version-dependent setup

Documentation-backed illustration. the example directory is writable and the target file does not exist; +mksession support; sessionoptions includes buffers,curdir,options,winsize. :mksession writes ExampleSession.vim. The files panel summarizes what the generated script restores; saving it does not close or restore the current session. Primary help: :mksession.

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

Save session info to 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 :mks[ession] 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.