我在 Solaris 上以 256 色模式使用 vim(在 Windows 上通过 Putty 连接)。在 tmux 之外,一切看起来都很棒并且工作正常,但在 tmux 内,当分页/滚动文件时,背景颜色会定期更改。
它应该是这样的:
以下是翻页后的显示效果:
谢谢!
最佳答案
As explained here ,通过清除 t_ut
终端选项来禁用 背景颜色删除 (BCE)(在 Vim 中运行 :set t_ut=
,然后按 Control +L 刷新终端的显示),以便在 tmux 和 GNU 屏幕中使用 Vim 时配色方案正常工作。
根据上面的链接,可以通过添加以下内容在 .vimrc 中设置 BCE
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
endif
关于vim中tmux分页时背景颜色变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6427650/