Search code examples
vimtmuxiterm2

Scroll with mouse in vim in tmux


I have mouse scrolling turned on in vim and tmux and I'm using iTerm 2 because it has mouse support. But when I'm running vim inside of tmux, sometimes I have the problem that tmux is catching or stealing the scroll event from vim, I can scroll down in vim just fine. That's probably because in tmux I'm already scrolled all the way down, but when I try to scroll back up in vim, it goes into tmux scrolling mode and I see [0/0] at the top and I can't scroll up in vim.

How can I get mouse scrolling to work with vim inside of tmux?


Solution

  • It turns out that the problem for me was caused by a vim plugin called tagbar: https://github.com/majutsushi/tagbar

    I removed this plugin and I could scroll with the mouse just fine.