Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I edit Vim's color scheme for better Syntax highlighting in Mac OS X Sierra/High Sierra?

I realize syntax highlighting is not enabled when editing files in vim by default. How do I activate it?

like image 231
Lindauson Avatar asked Oct 16 '25 14:10

Lindauson


1 Answers

Here's how to install syntax coloring in vim for Mac OS X Sierra/High Sierra:

1. Download a vim color scheme:

You can download one here: https://github.com/flazz/vim-colorschemes

2. Move color scheme into the colors directory inside your local .vim directory. (Create one if one does not exist.)

(Assuming scheme is in local Downloads folder) mv ~/Downloads/molokai.vim ~/.vim/colors/

Create the colors and ~/.vim directories if they do not exist: mkdir -p ~/.vim/colors/

3. Set syntax coloring in Mac OS X Sierra/High Sierra:

Run the following command in Terminal: set term=builtin_ansi

4. Update/Create local .vimrc file:

vim ~/.vimrc

Your .vimrc file should look similar to the following:

syntax on
colo molokai

5. Restart terminal

like image 124
Lindauson Avatar answered Oct 19 '25 00:10

Lindauson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!