Wikia

Vim Tips Wiki

Prompted quit in insert-mode

Talk0
1,613pages on
this wiki
Revision as of 21:07, August 1, 2011 by 95.222.147.211 (Talk)

Tip 673 Printable Monobook Previous Next

created March 9, 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
  else
    "???
  endif
endfunction
"
iab wq <BS><Esc>:call WQHelper()<CR>

Comments

what does it do?

Around Wikia's network

Random Wiki