Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use vim with the mouse

Tags:

vim

vi

editor

mouse

Is it possible to use vim with the mouse? If so, how?

like image 786
flybywire Avatar asked Apr 20 '09 10:04

flybywire


People also ask

Can we use mouse in Vim?

Mouse reporting is enabled in an app, such as Vim, that runs in a Terminal window. In general, mouse reporting is not enabled in apps by default. For example, to enable mouse reporting in Vim, you need to add a set mouse=a command to your ~/.

Do you need a mouse for Vim?

Its really a matter of preference. I sometimes use the mouse, but I find that it is much more efficient to not have to move my hands. If you spend a lot of time in vim, you may want to start learning the keyboard shortcuts and moving around using "hjkl" instead of the arrow keys. It saves you a lot of time.

How do I copy and paste with mouse in Vim?

You can use :set mouse& in the vim command line to enable copy/paste of text selected using the mouse. You can then simply use the middle mouse button or shift insert to paste it.

How do I enable scrolling in Vim?

":set mouse=a" is used to enable mouse scrolling/selection.


3 Answers

You can enable the mouse with :set mouse=a (The letter 'a' means enable it in all modes)

like image 72
soulmerge Avatar answered Oct 31 '22 21:10

soulmerge


With GVim, you can select text and move the cursor, and select menu options with the mouse. Copy and paste, by right-clicking etc... But I guess this misses the point of using VIM.

like image 45
Jose Basilio Avatar answered Oct 31 '22 19:10

Jose Basilio


You can map certain actions to mouse left click and right click. And there are plenty of already mapped actions to work with ctags and other things.

:help mouse-using
like image 43
Mykola Golubyev Avatar answered Oct 31 '22 21:10

Mykola Golubyev