I recently enabled mouse mode in vim:
set mouse=a
Which I love for scrolling but is awful for highlighting text. I am using vim in iTerm2 on a Mac. Now when I select text it's very slow to highlight (only highlighting after the highlight dragging is complete) and the highlighted text is not automatically copied into my clipboard, as it used to be when using iTerm2 to select.
Is there a way to allow mouse/trackpad-based scrolling in vim without using the mouse for visual-mode text selection?
I've tried:
set mouse=n
Which prevents the text from getting highlighted when I try and select, but it also prevents iTerm2 from highlighting text.
Update:
Thanks to this post I realized I can get almost the behavior I want by holding down the option key, but this is rather tedious. I would really like not to need to hold down the option key every time I select. Thoughts?
Update2:
Thanks to the suggestions in the comments I was able to get a bit closer. I needed to recompile vim so that +clipboard
is enabled:
brew install vim
Now if I'm willing to put up with not seeing my highlight in progress as a select text then I can at least still get it in the clipboard by yanking it after visual-mode selection. And if I really want better selection ergonomics I can hold down alt/option
and get the original iTerm2 selection behavior.
I wish I could reverse these modes. For example, default to the behavior that is accomplished by holding down alt/option
and enable the visual mode behavior when I want it with a key...but oh well, this is good enough.