Wednesday, June 19, 2013

Vim Editor : Some very common and useful shortcuts

As a programmer I think we use some tools to make our work easier. Most of the time it will be some hi-fi IDE, but I saw many good programmer using Vim Editor very efficiently.  And I must say it has equal capability if you use it properly.

So here I will try to cover few basic shortcuts which could make your life easier.

Shortcut                   Use

yy                        copy the current line in the buffer.

3yy                      copy multiple line (here 3) in the buffer.

p                          paste the buffer content after cursor position line.

P                          paste the buffer content before cursor position line.

D                         delete line at cursor position.

dd                        delete current line.

3dd                      delete multiple line(here 3).

/text                     search “text” in the current file.

:number                go to this line number

u                          undo the last change.

dw                       delete entire word

:%s/fff/rrrrr/g        find all instance of “fff” and replace it with “rrrrr”


And for more tutorial, refer following tutorial.
Hope it will help.

No comments: