Sunday, June 1, 2008
6:55 AM

How to disable vim syntax highlighting and coloring

Syntax highlighting is my top annoyance in using vi/vim. Syntax highlighting is just a fancy term meaning that the text editor will auto-color parts of a text file according to some rules that makes sense to it, using some default color scheme.

To be precise, only vim, not vi, has syntax highlighting. vi has a 2 color scheme only: background and foreground. Yet, on my Centos 4 system (and many other distros), the vi command is just a soft link to vim.

Syntax highlighting is useful, and usually nothing to complain about. However, I find the default vim color scheme to be an eye-killer for me.

If you are already in vi/m, you can disable it by typing
:syntax off (and press the return key).

To re-enable coloring, type
:syntax on (and press the return key).

If you want to permanently disable syntax highlighting, insert this in your ~/.vimrc file:
syntax off

Note that even with vim, there can be different versions. On my Debian Etch system, the vim is vim.tiny, and it does not support syntax highlighting. So, you don't need to explicitly disable syntax highlighting.

StumbleUpon Toolbar

0 comments:

Post a Comment