I\'m a Ruby programming trying to switch from Textmate to MacVim, and I\'m having trouble wading through the gargantuan lists of things you can do in VIM and all of the keyp
Go to Efficient Editing with vim and learn what you need to get started. Not everything on that page is essential starting off, so cherry pick what you want.
From there, use vim for everything. "hjkl", "y", and "p" will get you a long way, even if it's not the most efficient way. When you come up against a task for which you don't know the magic key to do it efficiently (or at all), and you find yourself doing it more than a few times, go look it up. Little by little it will become second nature.
I found vim daunting many moons ago (back when it didn't have the "m" on the end), but it only took about a week of steady use to get efficient. I still find it the quickest editor in which to get stuff done.
Have you run through Vim's built-in tutorial? If not, drop to the command-line and type vimtutor
. It's a great way to learn the initial commands.
Vim has an incredible amount of flexibility and power and, if you're like most vim users, you'll learn a lot of new commands and forget old ones, then relearn them. The built-in help is good and worthy of periodic browsing to learn new stuff.
There are several good FAQs and cheatsheets for vim on the internet. I'd recommend searching for vim + faq
and vim + cheatsheet
. Cheat-Sheets.org#vim is a good source, as is Vim Tips wiki.
@Greg Hewgill's cheatsheet is very good. I started my switch from TextMate a few months ago. Now I'm as productive as I was with TM and constantly amazed by Vim's power.
Here is how I switched. Maybe it can be useful to you.
Grosso modo, I don't think it's a good idea to do a radical switch. Vim is very different and it's best to go progressively.
And to answer your subquestion, yes, I use all of iaIAoO
everyday to enter insert mode. It certainly seems weird at first but you don't really think about it after a while.
Some commands incredibly useful for any programming related tasks:
r
and R
to replace characters<C-a>
and <C-x>
to increase and decrease numberscit
to change the content of an HTML tag, and its variants (cat
, dit
, dat
, ci(
, etc.)<C-x><C-o>
(mapped to ,,
) for omnicompletion<C-v>
Once you are accustomed to the Vim way it becomes really hard to not hit o
or x
all the time when editing text in some other editor or textfield.
Put this in your .bashrc to open vim with last edited file at last edited line
alias vil="vim +\"'\"0"