Vim Tips Wiki

Prompted quit in insert-mode

1,624pages on
this wiki
Add New Page
Talk0 Share
Tip 673 Printable Monobook Previous Next

created 2004 · complexity basic · author Yada · version 5.7

I find myself typing :wq in insert-mode many times. Add this to your vimrc.

function WQHelper()
  let x = confirm("Current Mode == Insert-Mode!\n Would you like ':wq'?"," &Yes \n &No",1,1)
  if x == 1
    silent! :wq
iab wq <BS><Esc>:call WQHelper()<CR>


what does it do?

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.