2

So I have a NeoVim setup I made a long time ago. A friend convinced me that the Solarized terminal theme was awesome and so I have that configured, not sure if I have a matching Vim theme.

Anyhow, when I started using Rust and C++, the compiler warnings were highlighted in the same color as the text. This was mostly for unused imports and the like, so I didn't bother much. However recently it got very much in my way when looking at C code.

This is the situation:

screenshot

(The line reads use std::io;, but the font color matches the highlight.)

So my question is if anyone knows how to edit the highlight color? I don't remember where I setup the theme, I think it might be in ~/.Xresources:

Xft.dpi: 104
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull Xcursor.size: 40

URxvt.termName: xterm-256color
URxvt.font: xft:DejaVu Sans Mono:pixelsize=24
URxvt.scrollBar: false
URxvt.scrollStyle: rxvt
URxvt.internalBorder: 20
URxvt.letterSpace: -2
URxvt.iso14755: False  
URxvt.iso14755_52: False

#define S_base03        #002b36
#define S_base02        #073642
#define S_base01        #586e75
#define S_base00        #657b83
#define S_base0         #839496
#define S_base1         #93a1a1
#define S_base2         #eee8d5
#define S_base3         #fdf6e3

*background:            S_base03
*foreground:            S_base0
*fadeColor:             S_base03
*cursorColor:           S_base1
*pointerColorBackground:S_base01
*pointerColorForeground:S_base1

#define S_yellow        #b58900
#define S_orange        #cb4b16
#define S_red           #dc322f
#define S_magenta       #d33682
#define S_violet        #6c71c4
#define S_blue          #268bd2
#define S_cyan          #2aa198
#define S_green         #859900

!! black dark/light
*color0:                S_base02
*color8:                S_base03

!! red dark/light
*color1:                S_red
*color9:                S_orange

!! green dark/light
*color2:                S_green
*color10:               S_base01

!! yellow dark/light
*color3:                S_yellow
*color11:               S_base00

!! blue dark/light
*color4:                S_blue
*color12:               S_base0

!! magenta dark/light
*color5:                S_magenta
*color13:               S_violet

!! cyan dark/light
*color6:                S_cyan
*color14:               S_base1

!! white dark/light
*color7:                S_base2
*color15: S_base3
  • "not sure if I have a matching Vim theme" – Probably not, at least the light blue of "std" seems to come from the 256-color palette. For Solarized you'll need a Vim color scheme that uses 16 colors only, and was designed for Solarized in particular. – egmont Sep 9 at 19:06
  • You'll also need to make sure that urxvt doesn't tamper with the colors when bold is requested, see superuser.com/q/512138. – egmont Sep 9 at 19:07
1

If you use Solarized, you need to configure it in both your terminal emulator and Vim (also, most of every other application that wants to seriously use terminal colors.)

For Vim, you can get the Solarized colorscheme from the altercation/vim-colors-solarized repository.

Follow the instructions on the README file in that repository, or if you already use a plug-in manager, use that to install that plug-in.

Make sure you're adding this line to your .vimrc:

colorscheme solarized

(You might want to explicitly set 'background' as well, to "dark" or "light", though Vim is usually pretty good at figuring that out from your terminal background color.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.