256 colors in Vim, OS X Lion

6,111

Solution 1

It is unnecessary for you to build Vim. The version of Vim installed with Mac OS X Lion 10.7 includes support for 256 colors. You simply need to install (and select) a color scheme that makes use of the extended color palette, e.g., desert256.

Solution 2

Try adding:

set t_Co=256

to your .vimrc to force the usage of 256 colors

Share:
6,111
Vakratund
Author by

Vakratund

Updated on September 18, 2022

Comments

  • Vakratund
    Vakratund over 1 year

    Since OS X Lion the terminal.app is xterm-256color terminal. However vim is rendering only 8 colors. I tried the 7.3 supplied with Lion and 7.3 that is terminal version of MacVim.

    Vim Wiki sais I need to set configure option --enable-256-color (before compiling), but I get configure: WARNING: unrecognized options: --enable-256-color.

    So how can I get 256 colors in terminal eventually?

    UPD: I tested color schemes: desert, dante, ir_black - and have only 8 or 16 colors.

    I also have set t_Co=256 in my .vimrc

    • sidyll
      sidyll over 12 years
      What's the color scheme you're using? Does it have support for 256 colors?
    • tungd
      tungd over 12 years
      I think changing $TERM may solve your problem. Go to Preferences -> Settings -> Advanced and set "Declare terminal as" to something like xterm-color or xterm-256color. Also try other 256 colorschemes like Mustang.
    • Chris Page
      Chris Page over 12 years
      @tungd, it should be set to xterm-256color (especially not xterm-color). Virtually anything else will tell applications that the terminal doesn't support 256 colors. Halst seems to be indicating that it's already set to xterm-256color, which is the default on Lion.
  • thunderblaster
    thunderblaster over 12 years
    +1, but only if this actually works :)
  • Chris Page
    Chris Page over 12 years
    No, that's unnecessary. The answer is you need a 256-color color scheme that actually uses the extra colors.
  • Macario
    Macario about 12 years
    he has already set t_Co=256
  • Macario
    Macario about 12 years
    I was having the same issue with ir_back, installing tir_black solved the issue, some keywords are colored slightly different than in macvim but it's allright.