35

I have seen this post :

oh-my-zsh themes don't show properly (background stays white)

But nothing helped.

Problem is in MAC VIM Colors are displaying messed but in linux all colors are working fine.

I am using iTerm 2 as in tutorial but here's how colors are showing.

enter image description here

Why this is not working ?

I think it should be link this :

enter image description here

Here are my settings in iTerm2

enter image description here

2
  • tutorial? Which vim colorscheme are you using? Commented May 6, 2016 at 23:05
  • 1
    Maybe you need set t_Co=256 if you use a 256 colors scheme but your terminal doesn't tell vim it supports 256 colors. Commented May 7, 2016 at 8:07

1 Answer 1

107

Test to see whether syntax highlighting is enabled in Vim. If you type :syntax on and the problem goes away then that's your issue, and you can correct it by adding:

syntax on

to your $MYVIMRC file (usually at ~/.vimrc or ~/.vim/vimrc. Find out exactly with :echo $MYVIMRC in Vim).

In case no such file exists then create a file ~/.vimrc and add syntax on to it and save the file.

4
  • If I type :syntax on it works. But I have no variable $MYVIMRC for a permanent fix. Commented Oct 10, 2018 at 17:51
  • How to permanently have :syntax on ? Do I have to type it every time? Commented Jan 25, 2019 at 18:36
  • 28
    Just create a file ~/.vimrc and syntax on to it and save. It worked for me even though I didn't have any variable $MYVIMRC Commented Mar 15, 2019 at 4:21
  • 2
    Thanks, syntax on is definitely NOT enabled. Adding that in the ~/.vimrc file solved it.
    – kramfs
    Commented Sep 28, 2020 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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