Prompt user when confirmation required
Example
Normal 0 / 3Command-line 1 / 3Awaiting confirmation 2 / 3Normal 3 / 3changed alphaCursor on line 1, column 1changed alphaCursor on line 1, column 1changed alphaCursor on line 1, column 1betaCursor on line 1, column 1Prompt user when confirmation required.
Current buffer
- Name
alpha.txt- modified
yes
Command entered · ready to apply
Current buffer
- Name
alpha.txt- modified
yes
Command line
- Typed text
:confirm edit beta.txt- Insertion offset
22
The modified current buffer needs a choice before :edit can continue.
Current buffer
- Name
alpha.txt- modified
yes
Unsaved-change confirmation
- Question
Save changes to "alpha.txt"?- Choices
Yes / No / Cancel
The confirmation asks about unsaved alpha.txt. Choosing No discards that buffer's changes and opens beta.txt.
Confirmation
- Question
Save changes to "alpha.txt"?- Illustrated choice
No
Current buffer
- Name
beta.txt- modified
no
Before & after
changed alphaCursor on line 1, column 1Current buffer
- Name
alpha.txt- modified
yes
betaCursor on line 1, column 1Confirmation
- Question
Save changes to "alpha.txt"?- Illustrated choice
No
Current buffer
- Name
beta.txt- modified
no
Documentation-backed illustration. a clean terminal Vim with +dialog_con and English messages; alpha.txt is a modified normal file buffer shown in only one window with bufhidden empty; hidden, autowrite and autowriteall are off and write is on; beta.txt exists with the shown contents and has not been loaded or visited; cmdheight=4, at least 80 columns and no pending messages; the illustrated user chooses No. The confirmation asks about unsaved alpha.txt. Choosing No discards that buffer's changes and opens beta.txt. Primary help: :confirm.
Details & Vim help
Prompt user when confirmation required. 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 :conf[irm] 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.