bigfish / vim-js-context-coloring

JavaScript Context Coloring in Vim
MIT License
151 stars 8 forks source link

Let guicolor works for terminal true color mode #11

Closed othree closed 10 years ago

othree commented 10 years ago

User using terminal true color mode won't pass has("gui_running"). So don't check gui_running. Just set gui color directly.

bigfish commented 10 years ago

cool, I didn't know about 24 color mode. I wonder if there's a way to detect it.. perhaps $TERM has a special value. Anyways, guifg will be ignored by most terminals (except 24color ones..) so this seems safe.

othree commented 10 years ago

You are right. I want to find a way to detect this 3rd party feature before I send this pull request. But I just forgot it and send this one.

There is a new option &guicolors. Can use exists('&guicolors') to check is Vim supports true color terminal mode. And if value of &guicolors is 1, means user enable true color terminal mode.

And vim --version will see +termtruecolor option is on.

othree commented 10 years ago

If you are using mac. You could try this yourself.

First. Get iTerm 2 nightly, then:

hg clone https://bitbucket.org/ZyX_I/vim
cd vim
hg update 8abaeea8b2e5
cd src && make autoconf && cd ..

./configure \
  --enable-gui=no \
  --without-x \
  --enable-multibyte \
  --with-tlib=ncurses \
  --enable-cscope \
  --with-features=huge \
  --disable-nls \
  --enable-perlinterp \
  --enable-pythoninterp \
  --enable-rubyinterp \
  --enable-termtruecolor

make
make install

I have an article in Chinese talk about how to install it.

bigfish commented 10 years ago

Cool, I will go test it out on my mac when I get a chance. If the &guicolors option exists then I could test for it as you suggest, and perhaps validate the color a bit more to detect errors in color definitions.