Wikia

Vim Tips Wiki

Changes: Prompted quit in insert-mode

Edit

Back to page

(Comments)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 4: Line 4:
 
|previous=672
 
|previous=672
 
|next=675
 
|next=675
|created=March 9, 2004
+
|created=2004
 
|complexity=basic
 
|complexity=basic
 
|author=Yada
 
|author=Yada
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
I find myself typing <tt>:wq</tt> in insert-mode many times. Add this to your vimrc.
+
I find myself typing <code>:wq</code> in insert-mode many times. Add this to your vimrc.
   
 
<pre>
 
<pre>

Latest revision as of 05:42, July 13, 2012

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

CommentsEdit

what does it do?

Around Wikia's network

Random Wiki