Saturday, August 14, 2010

VIM

I stumbled across a good vim book today and started reading. vim has mind boggling number of features. I just discovered an interesting one today. In vim you can jump to a particular character on a line very quickly. In the command mode just press f followed by the character. E.g. if you want to search for the letter 's' just type 'fs' and the cursor will move to the first location of s on the line.

I also practiced the recording feature today. q is the key used for recording. Like many other functions the recording feature also uses alphabets to store various states. Recording is done as follows. Press q followed by any alphabet that you want to identify the recording with. Let's say we use b as the alphabet. So press 'qb'. When you do that vim will show you the message 'record ing' in the status bar at the bottom. Now just perform any operations. When you are done press q. This will stop the recording, which will be identied by the alphabet 'b'. To run the recording press ampersand followed by the alphabet. For example in this case press '@b'.