首页 > vim 配色: 多种运行环境下配色失常

vim 配色: 多种运行环境下配色失常

提问者在用 xubuntu, apt-get install gvim, 会在三种情况下使用 vim:
* xfce4-terminal
* gvim
* <ctrl><alt><f[num]>

下面是我的尝试, 但也只是区分了这三种 '情况', 且实际运行不太理想,
确实不太懂它的配色这块.

if &term == "xterm"
    set t_Co=256
    colorscheme lucius
    set background=dark
elseif &term == "builtin_gui"
    set guioptions=
    colorscheme lucius
    set background=dark
    hi cursor guibg=#DB35EB
elseif &term == "linux"
endif

找到的一个资料 Optimized Vimrc with 256 Colorscheme


判断是否是GUI可以这样,会比较准确:

if has("gui")
  ...
endif

另外,xfce-terminal的terminal类型是可以调的,缺省可能是xtermxterm-color或者xterm-256color,你需要自己看看,Linux console(就是你所说的<f[num]>)的terminal类型是linux

【热门文章】
【热门文章】