help-nano
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Softwrap at words for Markdown editing


From: Benno Schulenberg
Subject: Re: Softwrap at words for Markdown editing
Date: Sun, 29 Sep 2024 17:55:34 +0200
User-agent: Mozilla Thunderbird


Hello Andreas,

Op 29-09-2024 om 12:12 schreef Andreas Schamanek:
I am often editing Markdown texts in an 80 columns wide terminal using nano
with --softwrap. Due to the fact that many URLs these days are longer than
what easily fits 1 line, quite often we see Markdown links produce quite some
empty space. Like e.g. after "[This" in

[This > example](https://www.this.example.org/archive/2024/long-...-url)

I think my personal preference would be to see a softwrap between `example]`
and `(https...`

Am I right that nano cannot do this currently because --atblanks wraps at
blanks only and there is no option to make nano wrap at punctuation,
"wordbounds" or "wordchars"?

Indeed: nano is primarily an editor for texts, for long series of
words separated by spaces and newlines.  So --atblanks wraps only
at whitespace, not at anything like punctuation or word boundaries.

It would be possible to make a patch to make nano do softwrap also
at word boundaries, but it will not be included into nano as checking
for such boundaries is costly and would slow softwrap down too much.
Also, with such word-edge wrapping your example would be wrapped as:

[This example](https://www.this.example.org/archive/2024/
long-...-url)

Am I a weirdo to use nano in a terminal for Markdown editing? Or is that a
not so uncommon use case?

Don't know.  But... my default terminal is 100 columns wide, so
overlong lines don't happen as much.  And whenever there are some,
I hit either M-S, to temporarily softwrap (my default mode is _not_
to softwrap), or F11 to temporarily make the terminal fullscreen,
until I'm done with the long lines.


Benno

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]