Monday, November 19, 2007

Comment a block of source code using Vim editor

To easily comment a block of source code using Vim editor do following:
  1. Enter the block-wise visual mode (using ctrl+v command) and select desired block with h, j, k and l keys. Selecting the most left columns of the lines that you want to comment is sufficient, as well.
  2. Type shift+i to enter insert mode and move cursor to the beginning of the first line in selected block.
  3. Type // if you want to add C line comments (#, ", etc. depending of the used programming language syntax).
  4. Type Esc to leave the visual mode.
Characters (from step 3) will be added at the beginning of every line in the block.


The block-wise visual mode can be also used in other situations. For example, if you want to add certain text in the middle of several adjacent lines you should do previously explained routine on the block which begins at the position where you want to insert the text.

Enjoy using Vim editor.

Monday, November 12, 2007

Change the capitalization of text using Vim editor

To change the capitalization of characters in a word, line, paragraph, etc. using Vim editor do the following:
  1. select the text which you want to change (using v, ctrl-v or shift-v in the command mode)
  2. type ~
All uppercase characters is replaced with lowercase ones.
All lowercase characters is replaced with uppercase ones.

For example:
  • TREE becomes tree
  • Dog becomes dOG
  • fish becomes FISH
  • SomeStrangeText becomes sOMEsTRANGEtEXT

Enjoy using Vim!

Friday, August 25, 2006

My first post

On August, 24th 2006. I have opened my blog. In the world, 75 millions of people already use blogs. At the basketball world cup, we have been defeated by Argentina. Still, we have qualified for the next round.