I'm using Vim in a terminal, so scrolling with the scroll wheel uses the \e[A
and \e[B
syntax (where \e
symbolizes \x1b
, or escape).
However, Vim interprets this by moving the cursor up or down a line. The desired behavior is that the screen is moved up or down, like <C-e>
and <C-y>
do.
How can I tell Vim to move the screen when I used my scroll wheel, while keeping the cursor on the same line? This should work in all common modes (insert, normal, visual select).
I've already tried, for example, :nnoremap <esc>[A <C-e>
(replacing <esc>
with a literal escape character inserted with Ctrl+V Esc), but this proved to be futile.
I'm using Vim 7.4.52 on Ubuntu 14.04 with GNOME.