My vim can't scroll in iTerm2 even set mouse=a
has added in .vimrc
file.
Within tmux, however, vim's scroll function works correctly.
What's wrong with my vim?
":set mouse=a" is used to enable mouse scrolling/selection.
Recent versions of vim support the "SGR" protocol, you can add code bellow to your .vimrc:
set mouse=a
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
I had the same issue, and Valery's answer did not work for me. What did work is checking the "Enable mouse reporting" box under Profiles > Terminal in the iTerm preferences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With