DigitalEye
DigitalEye

Reputation: 1565

Does vi support "confirm on quit"

When typing fast, I sometimes accidentally type :wq, when in fact I just wanted to :w. Obviously, this causes a major pain when I have a session with numerous files and I end up losing all my buffers and have to reopen those files one after another in a new session. Just wondering if vim supports a "confirm on quit" feature that can prevent me from shooting myself in the foot.

Upvotes: 2

Views: 504

Answers (1)

G. Bai
G. Bai

Reputation: 513

Easy solution: put set confirm in your vimrc. If you want more customization, consider writing function like in this plugin: https://github.com/vim-scripts/confirm-quit/tree/master/plugin

Upvotes: 6

Related Questions