Subscribe to How-To Geek

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…

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.

The Geek is the founder of How-To Geek and a geek enthusiast. This article was written on 09/9/07 and tagged with: Linux

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:
Similar Articles Featured Wiki Articles
Latest Software Reviews Quick Linux Tips
Geek Arcade Popular Forum Threads

Comments (6)

  1. Daniel Spiewak

    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

  2. The Geek

    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.

  3. robert

    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.

  4. Ricky

    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.

  5. The Geek

    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.

  6. Geoffrey

    > 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.


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Sponsored Links
Getting Started
About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
Cmd.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.