4

I am having a rough time getting the colors right with my vim setup and the color scheme I want to use.

Using:

  • OSX 10.10.2
  • Vim 7.4
  • iTerm2 (Set to report terminal type as "xterm-256color")
  • gruvbox theme
  • Using the gruvbox provided osx script to adjust color
  • Have tried adjusting the set t_Co=256 setting in my vimrc

Not matter what I have tried, the comment highlighting in my editor looks like the screenshot of they show as an example what it should NOT look like.

However - I did try download MacVim, and that worked just fine, but I am NOT interested in using MacVim, so please don't suggest that.

  • In iTerm, what does echo $TERM output? Additionally, you might want to check what :hi Comment says, particularly about the cterm setting. It might be setting italics when iTerm does not have support for italics (well it does but lets just assume it doesn't, because the solution is quite hacky) – akshay Mar 1 '15 at 3:12
  • Also, do not manually set t_Co. Vim is quite capable of reading the $TERM variable to see if the terminal does support 256colors. Manually setting it will break havoc (okay I exaggerate a bit) if the Terminal does not support 256 colors. – akshay Mar 1 '15 at 3:18
4

It looks like gruvbox sets italic on by default for the Comment syntax group if you're running terminal vim, which is a big problem if the terminal does not support italics. iTerm does but you have to get a specific termcap to enable it.

But it looks gruvbox recently fixed this issue. So, simply update your gruvbox colorscheme and the issue should be fixed.

  • Yep - looks like the update fixed my issue. Thanks! – Scott Mar 1 '15 at 17:43
2

I would suggest you to read this blog post, it explains how to add italic fonts to iterm2, tmux and vim.

Changing iterm2 .terminfo, worked like a charm for me.

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.