vimiterm2

Vim can't scroll in iTerm2


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?


Solution

  • 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