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.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.