Save current mappings and settings to a file
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Save current mappings and settings to a file.
Prepared workspace
- Options
number enabled- Global mapping
<F6> → :set number!<CR>
Output file
- example.exrc
absent
Command entered · ready to apply
Prepared workspace
- Options
number enabled- Global mapping
<F6> → :set number!<CR>
Output file
- example.exrc
absent
Command line
- Typed text
:mkexrc example.exrc- Insertion offset
20
:mkexrc writes example.exrc. The files panel summarizes what the generated script restores; saving it does not close or restore the current session.
Prepared workspace
- Options
number enabled- Global mapping
<F6> → :set number!<CR>
Configuration script written
- Filename
example.exrc- Meaningful contents
global <F6> mapping runs :set number!<CR>; window-local number state is not saved- Representation
summary; generated script includes version-dependent setup
Before & after
Before
Prepared workspace
- Options
number enabled- Global mapping
<F6> → :set number!<CR>
Output file
- example.exrc
absent
After
Prepared workspace
- Options
number enabled- Global mapping
<F6> → :set number!<CR>
Configuration script written
- Filename
example.exrc- Meaningful contents
global <F6> mapping runs :set number!<CR>; window-local number state is not saved- Representation
summary; generated script includes version-dependent setup
Documentation-backed illustration. the example directory is writable and the target file does not exist. :mkexrc writes example.exrc. The files panel summarizes what the generated script restores; saving it does not close or restore the current session. Primary help: :mkexrc.
alphaCursor on line 1, column 1Details & Vim help
Save current mappings and settings 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 :mk[exrc] 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.