Ask for confirmation before quitting Vim.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
plugin
LICENSE
README.markdown

README.markdown

This project is considered stable

Ask for confirmation before quitting Vim.

I originally wrote this as an answer on vi Stack Exchange.

The idea is based on the "ConfirmQuit" script.

To use it you'll need to remap keys that "quit" Vim as there's no other way to prevent Vim from quitting. This plugin comes with the following mappings by default:

cnoremap <silent> q<CR>  :call confirm_quit#confirm(0, 'last')<CR>
cnoremap <silent> wq<CR> :call confirm_quit#confirm(1, 'last')<CR>
cnoremap <silent> x<CR>  :call confirm_quit#confirm(1, 'last')<CR>
nnoremap <silent> ZZ     :call confirm_quit#confirm(1, 'last')<CR>

See :help confirm-quit for the full documentation.