arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Chromatica results for junegunn/seoul256 #33

Open kwon-young opened 7 years ago

kwon-young commented 7 years ago

Hi, I'm posting some images to show the results of Chromatica used with the colorscheme of junegunn/seoul256. Here is the results, I concatenated 4 images of cpp codes (hpp in term, src in term, hpp in gui, src in gui).

For comparison, when chromatica is not active: nofeat

When chromatica feature lvl 0 is active: feat0

When chromatica feature lvl 1 is active: feat1

For now, I think the feature lvl 0 of Chromatica is doing the best job. However, I found the gui color for the namespace and include file is really ugly. Is there a way to change it? (the term color is ok though) Also, the color for local variable is grey and not very visible on dark/grey background.

Thanks again for your great plugin!

arakashic commented 7 years ago

For the customization of highlight, you can set hi link <chromatica_syntax_group> <syntax_color> in your .vimrc. I have updated the master branch to make sure that user's setting always overrides the default. You can find all the default highlight in syntax/chromatica.vim. Most of them are linked to the default highlight groups that comes with vim/nvim.

One thing that is not very convenient right now is figuring out the syntax group for a specific identifier in your code. What I usually do is to check the AST dump of the current buffer (only the visible part). You can find related instructions at the bottom of my README.md.

For example, the highlight of include is controlled by chromaticaFile and chromaticaIncludedHeaderFile. The default settings for them are hi default link chromaticaIncludedHeaderFile Namespace hi default link chromaticaFile Namespace. If you change Namespace to cIncluded, the highlight would be more like the default of vim/nvim (or when feature_lvl==0). Part of the reason that the highlight for include is ugly is that the AST generated by libclang is problematic. I am afraid that it has caused some problem when feature_level=1.

For local variable, there are multiple syntax groups depending on whether the identifier is a declaration, a reference or something else.

Hope these are sufficient for customization the highlight.

P.S. I also noticed that in your last picture, the keywords are not highlighted correctly in terminal. Can you provide a bit more detail about the environment you were running (OS version, neovim version, etc.). Because I could not reproduce here with latest neovim and macOS 10.11.

kwon-young commented 7 years ago

For my environment, I'm running KDE Neon LTS 5.8, which is just an Ubuntu 16.04 LTS with the latest KDE desktop. I'm using the Ubuntu package for neovim, so it's the nightly build of neovim 0.2.0-dev

Thanks for your help, I think i'll be able to customize it on my own now!

KristupasSavickas commented 6 years ago

Is there a way to change the colors inside your init.nvim? I'm not experienced with vimscript so sorry if this is obvious to most.