Enabling mouse in vi editor in linux

While using the “vi” editor, one of the common problmes that we face is the inability to the mouse to move around in the file. Here is simple way to enable to usage of mouse in vi editor.

Open the vi editor in the command mode (Press “esc” to enter command mode) run the command

set mouse=a

Now you should be able to click any where in the document and the cursor will move to that location.

To enable the mouse every time “vi” is launched we need to open the file

/etc/vim/vimrc

And uncomment the line

“set mouse=a”

Note: un-commenting is done by removing the ‘ ” ‘ at the beginning of the line.

Save and close the file. From the next time any file is opened using “vi” editor the mouse will be enabled by default.


Tags: ,
Copyright 2017. All rights reserved.

Posted January 15, 2013 by Tux Think in category "Linux