Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I activate Vim color schemes in OS X's Terminal?

Tags:

vim

macos

I'm working with the Vim 7.2 that comes with Mac OS 10.6.1 (Leopard), using the Mac's "Terminal" app. I'd like to use a fancy color scheme. I did this...

:syntax on

Then this...

:colorscheme slate

:colorscheme elflord

:colorscheme desert

etc...

Syntax highlighting is working, but I'm finding that regardless of the scheme I choose, the only colors displayed are the basic Red, Blue, Cyan, Gray, etc.

Is there a way to get the Terminal app to display a larger collection of colors to allow some more subtle schemes?

like image 562
Ethan Avatar asked Oct 31 '09 05:10

Ethan


People also ask

How do I enable colors in vim?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.

How do I enable colors in Terminal Mac?

How do I configure Mac OS X Terminal app to have color ls output? You can enable colorized output by passing the -G option to ls command on Apple Mac OS X or FreeBSD operating system. You don't have to install anything special. Just pass the -G option to the ls command to enable colorized output on Unix box.

How do I enable syntax highlighting in vim Mac?

If you want to toggle this on/off (without creating a . vimrc file) simply type :syntax on while in vi/vim. Save this answer.

Where are vim color schemes stored Mac?

I found the answer here: color scheme's and syntax' files can be found in /usr/share/vim/ .


2 Answers

Create a .vimrc file on your home ~/ folder and then edit it with vim ~/.vimrc. You can try adding syntax on inside ~/.vimrc file. The following command does that:

echo "syntax on" >> ~/.vimrc

It will highlight your code syntax on vim

like image 57
skipper21 Avatar answered Oct 17 '22 20:10

skipper21


You need to create file ~/.vimrc and add syntax on in that file

vi ~/.vimrc

syntax on

save the file and run your vim

like image 22
ynz Avatar answered Oct 17 '22 21:10

ynz