search

Home  >  Q&A  >  body text

vim color matching: Color matching is abnormal in various operating environments

The questioner is using xubuntu, apt-get install gvim, which will be used in three situations vim:
* xfce4-terminal
* gvim
* <ctrl><alt><f[num]>

The following is my attempt, but it only distinguishes these three 'situations', and the actual operation is not ideal,
I really don’t understand its color matching.

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

A piece of information found Optimized Vimrc with 256 Colorscheme

为情所困为情所困2738 days ago615

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 16:42:46

    It will be more accurate to judge whether it is a GUI like this:

    if has("gui")
      ...
    endif
    

    In addition, the terminal type of xfce-terminal can be adjusted, and the default may be xtermxterm-color或者xterm-256color,你需要自己看看,Linux console(就是你所说的<f[num]>)的terminal类型是linux.

    reply
    0
  • Cancelreply