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…

image

Disable for Current Session

If you type :syntax off into the current editor, it’ll turn the syntax highlighting off immediately:

image

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 Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »