In an attempt to familiarize myself with the unfamiliar, I decided to build a fun side-project in Ruby and Vim. Effectively learning a new language, framework, and editor.
Coming from Nano, Quanta, Eclipse PDT, TextMate, Netbeans; I found (Mac/g)Vim is big a step, and first two weeks you should not expect to be productive.
But after some persistence, I’m now faster in Vim than I was in my previous editors. Except for NetBeans still. Maybe that changes as I get better, but having an editor that understands your code is also a powerful thing. Scope-aware refactoring and jumping to declarations make that I keep both NetBeans and Vim around. Cause Vim on the other hand let’s you navigate and hack on text like no other.
Investing in a tool like this pays off. For life.
Cause as so long as computers can’t read our minds, we’re better of maximizing the efficiency of our typing. If your brain has to wait for your hands to transfer the message, you’re just throwing away time & creativity flow.
Here are the resources that helped me get started with Vim.
Vim screencast tutorial (awesome series):
Other screencasts:
More resources:
- Vim Keyboard Cheat Sheet
- Vim Cheat Sheet
- Vim tips: Using tabs
- Use Vim like a pro
- Sync Vim Config across workspaces (on this blog)
Keyboard shortcuts
There are many Vim cheat-sheets out there, better than this one (see resources above). But still, I’ll continuously log useful shortcuts here so I won’t regress : )
Mode switching
1 2 3 4 5 | |
Command mode
1 2 3 4 5 6 | |
Normal mode
This is the mode you should generally be in. Don’t stick around in others longer than necessary.
Movement / Motions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
Manipulation
1 2 3 4 5 6 7 8 9 10 11 12 | |
Search & Replace
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Ranges
1
| |
Combined
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Insert mode
1 2 | |
Shell filtering
1 2 3 4 5 | |
Alright, that’s all I got for now. What are your experiences with Vim?
Imported comments
These were imported from my old blog. Please use disqus below for new comments
nelson
on 2012-05-29 03:43:58
I also had some trouble to learn vim. Each feature I learned, though kicked away another editor. It is today my favorite editor.
It surely pay off to learn a powerful tool like this.
Bryce Verdier
on 2012-02-07 01:20:39
I have to agree with Tin Dalos; how did you (efficiently) admin linux boxes without vim?
Thanks for the article, might I also recommend the pdf from vimgeeks here: http://billodom.com/vim/vim-from-essentials-to-mastery-2011.pdf
Lots of really cool tips and tricks in there to really help with your VIM mastery.
Tin Dalos
on 2011-07-27 17:09:34
Hi KvZ,
How the hell can you ( efficiently ) administer linux (UNIX) servers without knowing vi ( or vim if available ) ? No graphic sessions possible on secured machine and Nano is not always available.
Note: On Windows you can gVIM too, kill Notepad
Kevin
on 2011-04-17 17:03:20
@ primeminister: MacVim. And gVim on Ubuntu.
primeminister
on 2011-03-24 23:35:28
He Kevin,
What editor do you use on the mac? Just vin in your terminal of macvim or something else?
dilicious
on 2011-03-24 17:07:06
has subscribed you blog ,like you php article