Use mouse to scroll in Vim.

I installed gnome-vim in Ubuntu, and it can use mouse to scroll automatically. So I wonder how to make this work in my iMac and HPCC (CentOS 6.6).

vi ~/.vimrc

add set mouse=a, then save and quit

Now you can use mouse to scroll in Vim, it’s more convenient than using ctrl+d or ctrl+u.

Besides this command, my .vimrc also contains set number and set ruler.

The number will give the number of the line. It likes that you do nl file.txt > nl_file.txt, but it doesn’t change the file. The ruler will give the position of the prompt in Vim at the bottom right corner, which is good for the following sed or awk processing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s