Re: [PATCH] Allow 'set whitespacedisplay' in .nanorc
Ivan Vorontsov <[email protected]> Fri, 25 Apr 2025 18:11:34 +0300
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <aAumJhZlMhhAwY1y@DESKTOP-97PAREG> |
On Fri, Apr 25, 2025 at 01:04:38PM +0200, Benno Schulenberg wrote:
>
> Op 24-04-2025 om 17:06 schreef Peter Michaux:
> > Like Ivan, I have defined syntax for coloring whitespace by a light
> > color so it is not intrusive.
>
> You mean you use just one syntax for all of your files?
> Or have you extended all syntaxes with an extra rule?
I use one syntax for all files:
syntax default
color white "[ \t]+" # \t here for visibility
color lightred "[ \t]+$"
I use bright theme of my terminal. Before, I used color highlighting, but
after some time I got overwhelmed by different colors. Now, I prefer to
highlight only what to me matters visible distinction. And it's not much as
you can see.
> > I would like to be able to set whitespace to be displayed in .nanorc so
> > that it is always on when I start nano.
>
> But why? None of you explains why it is useful to see whitespace.
> What is it that you actually want to see? Do you want to see the
> dots so you can quickly count them and more easily see the difference
> between, say, five and six and seven spaces? Or do you just want to
> see the difference between tabs and spaces? Or more easily notice
> when there is an accidental double space? Or... what?
All these reasons are plausible. May I ask, why not?
> For some of those things it is much more useful to add specific
> coloring rules. For example, for multiple spaces between words:
>
> color ,red "\b +\b"
>
> To color tabs differently from spaces:
>
> color ,#222 " "
That's a one way to do it. But I prefer dots. And that's it, it's just
preference. Nano allows to do it with toggle function, but not with command
flag and setting as with other toggles. There are people who would like to
set the option in nanorc. Nobody will loose anything, but some will gain.