Tips about vim

09 Mar 2010 at 00:00:00 - 0 comment(s)

I am a vim user and I thought it would be interesting if I was sharing some of the stuff I like the most about vim as well as having this post as a reminder for myself. So here are few things about vim.

Find and replace every occurence of "tata" and replace it by "toto"

:%s/tata/toto/g

To split the window in half to have 2 files (or more) opened in the same window

:split file

To switch between two split window

ctrl + w + up/down key

To select a block of text

ctrl + v

To insert in front of every line selected using block of text

shift + i

To go at the end of the file

shift + g

To go at the beginning of the file

press g twice

To add something at the end of each lines

:%s/$/\something_added/g

0 comments

Notify me of follow up comments