30
11
I'd like to use the mouse in Vim only for scrolling (not to enable other Vim modes or otherwise interact with Vim). Using :set mouse=a
seems to be an all or nothing operation, can this be altered? Alternatively can iTerm be made to only pass through scroll events and never click/drag events?
Long Explanation: I use Vim in iTerm a lot and don't use the mouse. However, inertia scrolling with a trackpad is really nice and a great way to peruse large files. I can :set mouse=a
and use the trackpad to scroll and it's great. Now when I click however vim enters visual mode and iTerm will not copy selected text. I would like to retain iTerms ability to select and copy text.
I have thought about setting up Vim so that copying in vim will copy in Mac OS X (using pbcopy, I need to do this anyway). This will do the trick when editing local files, but most of the time I'm ssh
'd somewhere and editing remote files.
Where do you write
:set mouse=nicr
? – Naguib Ihab – 2019-04-29T06:14:56.9773Not quite what I need as while it will scroll in vim, iTerm won't let me select text. I've
:set mouse=i
so that scroll works in insert mode and iTerm select in normal mode. Close enough, so I'm marking answered. Thanks for the idea! – Jonah Braun – 2011-12-15T21:30:31.2033That looks like "set the mouse to be nicer" to me. – Kazark – 2012-08-30T17:07:50.970
6
@JonahBraun, iTerm will mouse select with
– John Whitley – 2013-03-22T23:58:38.060:set mouse=nicr
if you hold down option while making the selection. See http://stackoverflow.com/questions/4608161/copy-text-out-of-vim-with-set-mouse-a-enabled