Disable Syntax Highlighting in Vim
I’m the type of geek that always has an open ssh session connected to my servers, but ever since I switched to using a Mac running OS X, I noticed a huge annoyance in my terminal… the syntax highlighting makes it impossible to read the files I’m trying to edit.
Note that this isn’t the fault of OS X, it’s because I’ve got ansi color turned on and my settings configured wrong. So, how to disable syntax highlighting in Vim?
Look, somebody puked a rainbow into my terminal window…
Disable for Current Session
If you type :syntax off into the current editor, it’ll turn the syntax highlighting off immediately:
You could use the opposite command, :syntax on, to turn it back on and make your eyes bleed.
Turn Off Permanently (for current user)
In order to turn off highlighting permanently for your user account, you can edit the .vimrc file in your user directory and add the setting to turn off syntax highlighting. Run this command:
vi ~/.vimrc
Add the following line to disable syntax highlighting for your user account:
syntax off
If you wanted to enable highlighting, you could use “syntax on” instead.
Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:
| Similar Articles | Featured Wiki Articles |
| Latest Software Reviews | Quick Linux Tips |
| Geek Arcade | Popular Forum Threads |


Just a heads up, but part of the problem here is a) you’ve got a green-based font, and b) I think your VIM color settings are still on light background. If you go into /etc/vim/vimrc and dig around a bit, you should be able to find the setting which defines which color scheme to use. Choose the one you want, and then override the setting in ~/.vimrc. After that, syntax highlighting should work nicely without pain.
Daniel
I changed the setting to :set background=dark, which didn’t seem to change anything…
The other problem is that I haven’t found a console font I like in OS X yet… the default console font is too small, and when you increase the size it’s difficult to read because of the thickness of the letters.
Try Monaco on OS X, but also check the “Antialias text” box or it will suck. I use 13pt, because my eyesight is slowly failing.
Two things:
1) Change to white text. Green text is cool in the Matrix, and thats about it.
2) Keep syntax highlighting on. Take this advice from a seasoned veteran–it will make your life easier. First off, with white text, it won’t look like the rainbow monster died on your screen, so you don’t have to worry about that. In addition when the # of programming languages you know exceeds 12, you will find yourself liking syntax highlighting more and more, because it serves as a reminder when your memory becomes fuzzy.
I actually really prefer green text… I’ve been using it for years, way before the matrix ever came out.
I don’t use vim for serious work though… that’s what IDEs are for. I mostly use it when I’m modifying files on a server, or to make quick changes here or there.
> Look, somebody puked a rainbow into my terminal window…
Oh thank you for that bit of humor; I was really getting frustrated this morning. The sysadmins changed the vim defaults, and I was lost in the documentation of how to set up a colorscheme … but I didn’t want to set up a color scheme, I wanted to clear the one that was forced upon me …
I’m OK now, thanks to you.