Archive for the ‘ VIM ’ Category

Author : beriba | 06/08/2015

This is plain and simple. Just go to the line you want to select and hit

Author : beriba | 05/13/2013

By default vim editor doesn’t show line numbers. To change that behaviour you just have to do few very simple steps:

  • create file .vimrc in your home directory
  • touch ~/.vimrc
  • add below line to the above file
  • :set number

Save the file and voila. Any time you open vim, you will see line numbers.

Author : beriba | 03/10/2013

Vim is very powerful tool. But first you have to discover its secrets. Here is one of them – duplicating one line or many lines using just a keyboard. Yeah, that’s possible and very very useful. You just need to follow few simple steps:
1. Navigate to any place in the line you want to duplicate
2. Press yy
3. Navigate to any other line (or stay in the same line)
4. Press p to paste copied line below the line you’re in or P to paste it above

Quite simple, don’t you think? But what’s when you want to copy more than one line? Copying and pasting it line by line is not a great idea. There’s a command to do that. In step 2 instead of pressing yy you have to press 2Y. In this case the two lines will be copied – the line you’re in and the line below. After pasting, the additional blank line will be added above first copied line. You can copy as many lines as you wish. It could be 6Y, 10Y or 56Y.

Enjoy 🙂