256 colors in Vim, OS X Lion
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
Vakratund
Updated on September 18, 2022Comments
-
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 over 12 yearsWhat's the color scheme you're using? Does it have support for 256 colors?
-
tungd over 12 yearsI think changing $TERM may solve your problem. Go to Preferences -> Settings -> Advanced and set "Declare terminal as" to something like
xterm-color
orxterm-256color
. Also try other 256 colorschemes like Mustang. -
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 over 12 years+1, but only if this actually works :)
-
Chris Page over 12 yearsNo, that's unnecessary. The answer is you need a 256-color color scheme that actually uses the extra colors.
-
Macario about 12 yearshe has already set t_Co=256
-
Macario about 12 yearsI 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.