简体   繁体   English

Vim 无法在 iTerm2 中滚动

[英]Vim can't scroll in iTerm2

My vim can't scroll in iTerm2 even set mouse=a has added in .vimrc file.我的 vim 无法在 iTerm2 中滚动,即使set mouse=a已添加到.vimrc文件中。

Within tmux, however, vim's scroll function works correctly.然而,在 tmux 中,vim 的滚动功能可以正常工作。

What's wrong with my vim?我的vim有什么问题?

Recent versions of vim support the "SGR" protocol, you can add code bellow to your .vimrc:最新版本的 vim 支持 "SGR" 协议,您可以在 .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.有效的是选中 iTerm 首选项中“配置文件”>“终端”下的“启用鼠标报告”框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM