Vim Tips Wiki
No edit summary
 
(Added to Syntax Category + code reformated)
Line 11: Line 11:
 
If you're like me, you don't want a colorful editor. I spent hours looking for a "turn off all those colors right now!!" command and I couldn't find any help. After some poking around for a while, I found the commands you need. Just put these at the end of your .vimrc file.
 
If you're like me, you don't want a colorful editor. I spent hours looking for a "turn off all those colors right now!!" command and I couldn't find any help. After some poking around for a while, I found the commands you need. Just put these at the end of your .vimrc file.
   
 
syntax off
 
set nohlsearch
 
set t_Co=0
   
 
If you don't have a .vimrc file, simply create one in your home directory.
   
 
The commands I have described will work for version 6.1. If you have some other version, try them and see if they work.
syntax off
 
   
 
-mdmiller
set nohlsearch
 
 
set t_Co=0
 
 
 
 
If you don't have a .vimrc file, simply create one in your home directory.
 
 
The commands I have described will work for version 6.1. If you have some other version, try them and see if they work.
 
 
-mdmiller
 
   
   
Line 59: Line 53:
 
----
 
----
 
What's wrong with
 
What's wrong with
 
:syntax off
 
:syntax off
 
 
 
?
 
?
   
Line 67: Line 59:
 
, May 25, 2004 20:15
 
, May 25, 2004 20:15
 
----
 
----
With "syntax off" alone vim will still use colored highlighting when you search for things. For those who simply think colors are yucky, that's reason enough. For me, there's also the fact that I usually lose interest in a search term a few minutes after I find it. (i.e. find where a variable is used, examine the use of that variable, then move on to something unrelated.) I find it disconcerting to have something highlighted when it is no longer important to me. Yes, I know there is a way to turn off the highlight from the previous search, but it takes more keystrokes than I want to mess with. And I could simply search for something that isn't in the file I'm editing, but such a kluge of an answer disturbs me.
+
With "syntax off" alone vim will still use colored highlighting when you search for things. For those who simply think colors are yucky, that's reason enough. For me, there's also the fact that I usually lose interest in a search term a few minutes after I find it. (i.e. find where a variable is used, examine the use of that variable, then move on to something unrelated.) I find it disconcerting to have something highlighted when it is no longer important to me. Yes, I know there is a way to turn off the highlight from the previous search, but it takes more keystrokes than I want to mess with. And I could simply search for something that isn't in the file I'm editing, but such a kluge of an answer disturbs me.
  +
So the next thing I tried was "syntax off" + "set t_Co=0", and that made vim comepletely colorless, but search result highlighting was accomplished through alternate means - I believe bold or italics or some such thing. To clarify what I wrote in the previous paragraph, the emphasis of a currently uninteresting search result is the thing I dislike, not the means of the emphasis. So this option was not good enough for me.
+
So the next thing I tried was "syntax off" + "set t_Co=0", and that made vim comepletely colorless, but search result highlighting was accomplished through alternate means - I believe bold or italics or some such thing. To clarify what I wrote in the previous paragraph, the emphasis of a currently uninteresting search result is the thing I dislike, not the means of the emphasis. So this option was not good enough for me.
I also tried "syntax off" + "set nohlsearch". This option is nice most of the time, but vim still used colors to emphasize some of its error messages. By the time I discovered this, I was so frustrated with vim that I wanted to beat it into submission. I wanted no colors, no emphasized text, nothing that looked at all different than traditional vi. (I know, this is a silly emotional reaction. But when you use technology all day, it needs to be comfortable. And "comfort" is a word that can only be completely defined in an emotional context.)
 
  +
For my purposes, "syntax off" + "set nohlsearch" + "set t_Co=0" is the only satisfying option. Leaving out any ingredient gives me something that is not good enough. Given that "syntax off" + "set t_Co=0" will produce a colorless vim, perhaps I did not choose the best title for my tip, but people seem to be enjoying it, so I have no regrets.
 
 
I also tried "syntax off" + "set nohlsearch". This option is nice most of the time, but vim still used colors to emphasize some of its error messages. By the time I discovered this, I was so frustrated with vim that I wanted to beat it into submission. I wanted no colors, no emphasized text, nothing that looked at all different than traditional vi. (I know, this is a silly emotional reaction. But when you use technology all day, it needs to be comfortable. And "comfort" is a word that can only be completely defined in an emotional context.)
Now you know what is wrong (from my personal point of view) with just typing "syntax off".
 
  +
-mdmiller
 
 
For my purposes, "syntax off" + "set nohlsearch" + "set t_Co=0" is the only satisfying option. Leaving out any ingredient gives me something that is not good enough. Given that "syntax off" + "set t_Co=0" will produce a colorless vim, perhaps I did not choose the best title for my tip, but people seem to be enjoying it, so I have no regrets.
  +
 
Now you know what is wrong (from my personal point of view) with just typing "syntax off".
 
-mdmiller
   
   
Line 84: Line 80:
 
----
 
----
 
<!-- parsed by vimtips.py in 0.579695 seconds-->
 
<!-- parsed by vimtips.py in 0.579695 seconds-->
  +
  +
[[Category:Syntax]]

Revision as of 16:50, 17 August 2007

Previous TipNext Tip

Tip: #675 - How to turn off all colors

Created: March 12, 2004 12:34 Complexity: intermediate Author: mdmiller Version: 6.0 Karma: 68/30 Imported from: Tip#675

If you're like me, you don't want a colorful editor. I spent hours looking for a "turn off all those colors right now!!" command and I couldn't find any help. After some poking around for a while, I found the commands you need. Just put these at the end of your .vimrc file.

syntax off 
set nohlsearch 
set t_Co=0 

If you don't have a .vimrc file, simply create one in your home directory.

The commands I have described will work for version 6.1. If you have some other version, try them and see if they work.

-mdmiller

Comments

Thank god this one got googled. For some reason, the newer version of vim did this when I upgraded. Colors aren't always good with transparent aterms :) Thanks!

anonymous--AT--host.com , March 23, 2004 19:15


Wow. you saved me one more day of total frustration. Navy blue and dark purple on a black background bordered on stealth mode. I was editing dozens of files to change similar lines, and I would end up just changing the ones I could see. Now I'll go back to making it all work. Thanks.

Anonymous , April 5, 2004 18:27


You have saved another set of eyes, good sir.

Anonymous , April 19, 2004 13:26


If you want coloring sometimes but want an easy way to turn it off occasionally (while editing) type

set syntax=


anonymous , April 20, 2004 12:49


It is good that I got this mail when googled. Other wise I would have end up with one day with R&D on vim

dhananjaya.eadala--AT--oracle.com , May 7, 2004 23:10


What's wrong with

:syntax off 

?

Anonymous , May 25, 2004 20:15


With "syntax off" alone vim will still use colored highlighting when you search for things. For those who simply think colors are yucky, that's reason enough. For me, there's also the fact that I usually lose interest in a search term a few minutes after I find it. (i.e. find where a variable is used, examine the use of that variable, then move on to something unrelated.) I find it disconcerting to have something highlighted when it is no longer important to me. Yes, I know there is a way to turn off the highlight from the previous search, but it takes more keystrokes than I want to mess with. And I could simply search for something that isn't in the file I'm editing, but such a kluge of an answer disturbs me.

So the next thing I tried was "syntax off" + "set t_Co=0", and that made vim comepletely colorless, but search result highlighting was accomplished through alternate means - I believe bold or italics or some such thing. To clarify what I wrote in the previous paragraph, the emphasis of a currently uninteresting search result is the thing I dislike, not the means of the emphasis. So this option was not good enough for me.

I also tried "syntax off" + "set nohlsearch". This option is nice most of the time, but vim still used colors to emphasize some of its error messages. By the time I discovered this, I was so frustrated with vim that I wanted to beat it into submission. I wanted no colors, no emphasized text, nothing that looked at all different than traditional vi. (I know, this is a silly emotional reaction. But when you use technology all day, it needs to be comfortable. And "comfort" is a word that can only be completely defined in an emotional context.)

For my purposes, "syntax off" + "set nohlsearch" + "set t_Co=0" is the only satisfying option. Leaving out any ingredient gives me something that is not good enough. Given that "syntax off" + "set t_Co=0" will produce a colorless vim, perhaps I did not choose the best title for my tip, but people seem to be enjoying it, so I have no regrets.

Now you know what is wrong (from my personal point of view) with just typing "syntax off". -mdmiller


Anonymous , May 26, 2004 16:32


Is there any system-wide config file to get rid of the colors? To date I have not had one user that hasn't complained about the colors and nearly everyone has grumbled about having to modify their own .vimrc. (My users are dba's nuf-said)

rcp--AT--panduit.com , June 30, 2004 10:16