Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How to disable colors in vi (vim) editor on Linux (or WSL)?

412 views
Skip to first unread message

Kenny McCormack

unread,
Mar 13, 2022, 11:16:09 AM3/13/22
to
In article <t0klig$j7j$2...@dont-email.me>,
Chris Elvidge <ch...@mshome.net> wrote:
>On 15/02/2022 20:13, James wrote:
>> All I want is white on dark background or vise versa.
>>
>> Thanks
>> James
>>
>
>Put 'syntax off' at the end of your .vimrc file.

Or just turn the computer off. (I.e., turning syntax off is about as
stupid as turning the whole computer off).

Anyway, this question was recently raised and answered - in a slightly
different guise, but the same basic question - in one or the other of these
newsgroups - I think either this one (shell) or comp.editors. And the
answer, provided, I think, by Mr. Elijah, was to do:

set t_Co=0

This tells vim that your terminal has zero colors. You still get syntax
highlighting (which is key), but it is all done with shades of black,
white, and grey.

I find this useful - and have an alias of:

alias vi='vim -c "set t_Co=0"'

in my LXDE windows. Because for some reason, the combination of LXDE's
default color scheme (white on black) and VIM's color scheme for syntax
highlighting (particularly, for shell scripts) is horrid.

--
"If our country is going broke, let it be from feeding the poor and caring for
the elderly. And not from pampering the rich and fighting wars for them."

--Living Blue in a Red State--

Lewis

unread,
Mar 13, 2022, 2:34:43 PM3/13/22
to
In message <t0l1ri$1j650$1...@news.xmission.com> Kenny McCormack <gaz...@shell.xmission.com> wrote:
> In article <t0klig$j7j$2...@dont-email.me>,
> Chris Elvidge <ch...@mshome.net> wrote:
>>On 15/02/2022 20:13, James wrote:
>>> All I want is white on dark background or vise versa.
>>>
>>> Thanks
>>> James
>>>
>>
>>Put 'syntax off' at the end of your .vimrc file.

> Or just turn the computer off. (I.e., turning syntax off is about as
> stupid as turning the whole computer off).

> Anyway, this question was recently raised and answered - in a slightly
> different guise, but the same basic question - in one or the other of these
> newsgroups - I think either this one (shell) or comp.editors. And the
> answer, provided, I think, by Mr. Elijah, was to do:

> set t_Co=0

That will come in handy for those times where one particular color
(usually the dark blue) is unreadable my screen. I'd completely
forgotten about this setting but I did use it quite some time ago when I
had a greyscale 'page view' monitor.

--
Everybody knows the "secret sexy maid on the outside" trope.

Dan Espen

unread,
Mar 13, 2022, 5:58:38 PM3/13/22
to
That dark blue is a hazard.
Depending on your terminal program you can get rid of it.
xterm and rxvt can be tuned with x-resources.
I use cornflowerblue instead.
Other terminals are pretty sure to have a way.
Just because the escape sequence sent to the terminal is asking for blue
doesn't mean the terminal has to display blue.

--
Dan Espen

Keith Thompson

unread,
Mar 13, 2022, 7:20:16 PM3/13/22
to
Andreas Kohlbach <a...@spamfence.net> writes:
[...]
> It also take about 3 seconds to loads. Irritating that parts of the text
> has syntax highlighting, the other not.
>
> Solution is
>
> set re=0
>
> to disable the regex machine. With that the large page loads in a flash.
>
> F'up2 comp.editors

For more information:

:help regexpengine
:help two-engines

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Javier

unread,
Mar 14, 2022, 9:27:23 PM3/14/22
to
In comp.unix.shell Dan Espen <dan1...@gmail.com> wrote:
>
> That dark blue is a hazard.
> Depending on your terminal program you can get rid of it.
> xterm and rxvt can be tuned with x-resources.
> I use cornflowerblue instead.
> Other terminals are pretty sure to have a way.
> Just because the escape sequence sent to the terminal is asking for blue
> doesn't mean the terminal has to display blue.

I also get anoyed by the dark blue on black background. It's especially
common in the syntax highlighting in 'emacs -nw'.

Which is the X-resource for xterm that disables a specific color?
I never used that.

Dan Espen

unread,
Mar 14, 2022, 11:49:51 PM3/14/22
to
Try this:

XTerm*color0: Black
XTerm*color1: Red
XTerm*color2: Green
XTerm*color3: Yellow
XTerm*color4: cornflowerBlue
XTerm*color5: Magenta
XTerm*color6: Cyan
XTerm*color7: White
XTerm*color8: gray
XTerm*color9: pink
XTerm*color10: YellowGreen
XTerm*color11: orange
XTerm*color12: turquoise
XTerm*color13: wheat
XTerm*color14: lightblue
XTerm*color15: tan

Rxvt accepts the "XTerm" resources.


--
Dan Espen

Lewis

unread,
Mar 15, 2022, 8:17:21 AM3/15/22
to
In message <t0lpec$jd6$1...@dont-email.me> Dan Espen <dan1...@gmail.com> wrote:
> Lewis <g.k...@kreme.dont-email.me> writes:

>> In message <t0l1ri$1j650$1...@news.xmission.com> Kenny McCormack <gaz...@shell.xmission.com> wrote:
>>> In article <t0klig$j7j$2...@dont-email.me>,
>>> Chris Elvidge <ch...@mshome.net> wrote:
>>>>On 15/02/2022 20:13, James wrote:
>>>>> All I want is white on dark background or vise versa.
>>>>>
>>>>> Thanks
>>>>> James
>>>>>
>>>>
>>>>Put 'syntax off' at the end of your .vimrc file.
>>
>>> Or just turn the computer off. (I.e., turning syntax off is about as
>>> stupid as turning the whole computer off).
>>
>>> Anyway, this question was recently raised and answered - in a slightly
>>> different guise, but the same basic question - in one or the other of these
>>> newsgroups - I think either this one (shell) or comp.editors. And the
>>> answer, provided, I think, by Mr. Elijah, was to do:
>>
>>> set t_Co=0
>>
>> That will come in handy for those times where one particular color
>> (usually the dark blue) is unreadable my screen. I'd completely
>> forgotten about this setting but I did use it quite some time ago when I
>> had a greyscale 'page view' monitor.

> That dark blue is a hazard.
> Depending on your terminal program you can get rid of it.

Oh, on MY terminal it's not a problem, but I am often using other
people's computers when I am trying to fix them, and changing the colors
every time is just annoying.

Also, my terminal is iTerm2, and on others machines I am in the Mac's
default Terminal.app, so there I would have to remember how to change
the color and then change the color.

--
I'm from a predominately black family --Eddie Murphy
0 new messages