TL;DR
This post is about vim and how you can start using it in your daily work.
At one point in my testing path, I decided that I should start using vim. I opened Google, and start my search journey. I searched for:
“vim development platform”
What got my intention was search result:
spf13-vim – The Ultimate Vim Distribution
This is “spf13-vim is a distribution of vim plugins and resources for Vim, Gvim and MacVim. Which means that you need to install vim by yourself, and this distribution will add a set of useful vim plugins for development. Adding new plugin is also simplified (although, you need to know linux cat basics to do that).
For me, important one are related to ruby language. Here is one rspec file, opened in mvim:
Yes, you have coloured syntax. For me, this is very important, because with colours, I make less syntax errors!
Ok, you are set to go and you expenses so far are 0.
To get to know basic, run vimtutor (linux and mac os have it, for windows read this).
Here is set of vim cmd’s that I use on daily basics:
- fire up vim: cd to your development folder and type:
mvim &
- enter command mode
-
:
- start folder explorer vim plugin (note, tab will complete your commands, so you can type Expl, then hit tab, and vim will do autocomplete
-
:Explore
- open file in new tab
-
select file with arrow keys, then press t
- close file
-
:q!
- go to file bottom
-
G
- go to file top
-
gg
- go to end of line
-
$
- go to start of line (this is zero)
-
0
- delete line
-
dd
- undo action
-
u
- start edit mode (you know that you are in edit mode when you see this in the bottom of vim
-
i
- exit edit mode (you need to do that in order to do all other commands listed here
-
esc
- delete character on the right
-
x
- copy paste action. Note, if you start typing after you hit p, copied item is cleared from the buffer.
-
v, then with arrow keys make a selection, y, go to position when you want to paste, p, text will be pasted on the right of cursor
- search
-
/, what you search, enter, found text will be highlighted, with n you move to next found item.
That it is. This is small set of features what vim can do, but for me it is enough to be productive!