Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I did find this answer here: Vim Stuck In Insert Mode

However none of the commands listed worked for me. Exit, cntrl + [, cntrl + q

I'm a totally terminal newb, trying to learn how to setup git using homebrew. Watching this tutorial and I was able to set my global username and email, but I'm stuck in VIM.

I can get out of it by quitting the terminal, but I have to do this everytime :(

Is there a better way?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

:q is not good because you need to save the file manually before quit.

If you use main window only(no tabs), :wq or equivalent ZZ is better. They will save and quit. ZZ is easier to type.

I use tabs often, so normal commands :wq or ZZ can't fit my need.

Then I made such mapping in vimrc

"Quit vim with saving all tabs and buffers
nnoremap WQ :wqa<CR>

After this, I forget all other quit options, only this one to fit all.

share|improve this answer
add comment

Just found out that I need to use :q or :q!

share|improve this answer
2  
Then you weren't in insert mode. –  Ignacio Vazquez-Abrams May 18 '13 at 5:34
    
Ah thanks, yeah everything is still pretty alien too me, I have no idea why someone would want to code in VIM yet, but I'm a front-end guy, maybe it's more of a backend thing –  Leon Gaban May 18 '13 at 5:39
1  
Vim is... primarily a sysadmin tool. It just happens to be useful enough for coding. –  Ignacio Vazquez-Abrams May 18 '13 at 5:40
    
Vim is pretty useful if you use it remotely (e.g. via SSH). Also, it has several features that used to be not as powerful or easy to access in other editors, especially non-GUI ones. I've been using vim for ten years (still do), but today, for a GUI, I'd maybe suggest Eclipse. I hope not to start an editor war here :-) –  lserni May 18 '13 at 6:22
    
Also, you might be interested in this: stackoverflow.com/questions/442057/… –  lserni May 18 '13 at 6:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.