• Re: ed __ ___ ________ ____ ______.

    From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.unix.shell on Fri Jun 12 16:56:18 2026
    On 2026-06-11 22:40, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-06-10 01:29, Keith Thompson wrote:
    [...]
    The par program by default does not format text the way
    Lumin Etherlight does. They might be using par with options.
    "par -j" formats paragraphs by inserting spaces so the text is
    right-justified. "par -j -w50" does the same, but with 50-character
    lines. I don't see an option to insert two leading spaces on
    each line.

    (I'm a bit astonished that Vim doesn't natively support that. -
    Or does it, and I just don't know about it?)

    It does, and I didn't know about it either. "gq" followed by a
    motion command formats text, possibly using a configured external
    program. ":help gq" in vim for more information. (I've been using
    key mappings to invoke "fmt" since before I'd even heard of vim.)

    Oh, I obviously was unclear. - I had been talking about the
    left-and-right block-alignment; the format we saw in Lumin's post.

    'fmt' does *not* support that functionality. But 'par' *does*.

    Both can be used from within Vi or Vim with its _external filter_
    interface. But both are not *natively* supported in Vi. And 'gq'
    in Vim supports *native* formatting like 'fmt', but not like 'par'.

    You can also configure external commands. But my question was about
    a "native" support; because I like editing functions independent
    of environmental support, and I don't like plugins (which would be
    another options for those who think plugins are a good idea).

    Janis

    [...]
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.unix.shell on Fri Jun 12 15:22:47 2026
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-06-11 22:40, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-06-10 01:29, Keith Thompson wrote:
    [...]
    The par program by default does not format text the way
    Lumin Etherlight does. They might be using par with options.
    "par -j" formats paragraphs by inserting spaces so the text is
    right-justified. "par -j -w50" does the same, but with 50-character
    lines. I don't see an option to insert two leading spaces on
    each line.

    (I'm a bit astonished that Vim doesn't natively support that. -
    Or does it, and I just don't know about it?)
    It does, and I didn't know about it either. "gq" followed by a
    motion command formats text, possibly using a configured external
    program. ":help gq" in vim for more information. (I've been using
    key mappings to invoke "fmt" since before I'd even heard of vim.)

    Oh, I obviously was unclear. - I had been talking about the
    left-and-right block-alignment; the format we saw in Lumin's post.

    'fmt' does *not* support that functionality. But 'par' *does*.

    No I don't think you were unclear. I use "fmt" rather than
    "par" because (a) "par" probably didn't exist when I started
    using "fmt" (and I'm not sure "vim" did), and (b) I don't *want* left-and-right-justified text. I'm now aware that vim has a built-in
    feature for formatting paragraphs, but as Darth Vader would say,
    "The intertia is strong with this one".

    Both can be used from within Vi or Vim with its _external filter_
    interface. But both are not *natively* supported in Vi. And 'gq'
    in Vim supports *native* formatting like 'fmt', but not like 'par'.

    You can also configure external commands. But my question was about
    a "native" support; because I like editing functions independent
    of environmental support, and I don't like plugins (which would be
    another options for those who think plugins are a good idea).

    Quoting the vim documentation:
    """
    JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify*

    Vim has no built-in way of justifying text. However, there is a neat macro package that does the job. To use this package, execute the following
    command: >vim

    :packadd justify

    Or put this line in your |vimrc|: >vim

    :packadd! justify
    """
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
  • From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.unix.shell on Sat Jun 13 00:58:26 2026
    On 2026-06-13 00:22, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-06-11 22:40, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    On 2026-06-10 01:29, Keith Thompson wrote:
    [...]
    The par program by default does not format text the way
    Lumin Etherlight does. They might be using par with options.
    "par -j" formats paragraphs by inserting spaces so the text is
    right-justified. "par -j -w50" does the same, but with 50-character
    lines. I don't see an option to insert two leading spaces on
    each line.

    (I'm a bit astonished that Vim doesn't natively support that. -
    Or does it, and I just don't know about it?)
    It does, and I didn't know about it either. "gq" followed by a
    motion command formats text, possibly using a configured external
    program. ":help gq" in vim for more information. (I've been using
    key mappings to invoke "fmt" since before I'd even heard of vim.)

    Oh, I obviously was unclear. - I had been talking about the
    left-and-right block-alignment; the format we saw in Lumin's post.

    'fmt' does *not* support that functionality. But 'par' *does*.

    No I don't think you were unclear. I use "fmt" rather than
    "par" because (a) "par" probably didn't exist when I started
    using "fmt" (and I'm not sure "vim" did), and (b) I don't *want* left-and-right-justified text. I'm now aware that vim has a built-in
    feature for formatting paragraphs, but as Darth Vader would say,
    "The intertia is strong with this one".

    Then we were (and probably still are!) talking at cross purposes.

    I had been asking for a built-in 'par' like function; there isn't
    one. (And I thought you had been trying to support my request with
    the hints to 'fmt' in your post. - So *I* probably misinterpreted
    your post as being an answer to my question.)

    I also don't like block-formatting for posts. But it's useful for
    specific purposes, and since it's an common editing/presentation
    task it should (as Vim's 'gq') be a Vim built-in, in my opinion.

    ('gq' I'm actually using with Vim already for a very long time.
    It's very useful and easy to type and use.)


    Both can be used from within Vi or Vim with its _external filter_
    interface. But both are not *natively* supported in Vi. And 'gq'
    in Vim supports *native* formatting like 'fmt', but not like 'par'.

    You can also configure external commands. But my question was about
    a "native" support; because I like editing functions independent
    of environmental support, and I don't like plugins (which would be
    another options for those who think plugins are a good idea).

    Quoting the vim documentation:
    """
    JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify*

    Vim has no built-in way of justifying text.

    Vim has 'gq' formatting natively; see point 3. below (:help gq).

    gq{motion} Format the lines that {motion} moves over.
    Formatting is done with one of three methods:
    1. If 'formatexpr' is not empty the expression is
    evaluated. This can differ for each buffer.
    2. If 'formatprg' is not empty an external program
    is used.
    3. Otherwise formatting is done internally.

    In my standard Vim environment, the settings of 1. and 2. are empty.
    So internal (native) formatting is used.

    However, there is a neat macro
    package that does the job. To use this package, execute the following command: >vim

    :packadd justify

    Or put this line in your |vimrc|: >vim

    :packadd! justify
    """

    Yes, and this is plugin! - I said that I don't like to use plugins.
    I use Vim *natively* with what it comes; it's extremely powerful as
    it is already, and I want to avoid dependencies like external 'par'
    commands or any plugins!

    I've got an answer to my original "native block-formatting question"
    ("Or does it, and I just don't know about it?") also from the Vim
    mailing list:

    There is no built-in command but there is a plugin distributed
    with vim. See ":help justify".

    So I'm fine with my curiosity about that. And we can close the topic
    (at least as far as my question goes). :-)

    Janis
  • From Daniel Cerqueira@dan.list@lispclub.com to comp.unix.shell on Fri Jul 3 00:55:34 2026
    --=-=-=
    Content-Type: text/plain
    Content-Transfer-Encoding: quoted-printable

    Joerg Mertens <joerg-mertens@t-online.de> writes:

    Daniel Cerqueira <dan.list@lispclub.com> writes:

    Lumin Etherlight <lumin+usenet@etherlight.link> writes:

    Perhaps, better yes. But if one editor is
    worthy of being discussed in comp.unix.shell, it's
    ed, because ed is almost completely useless if not
    for the shell. I spell check in ed by calling to
    a shell program !aspell %, I format the post by
    doing the same !par, when I want a calendar in my
    task file I !cal, etc. etc. Personally, I think
    ed is the only editor that follows the UNIX
    philosophy closely, it applies edits to text, and
    it does so very well.

    When I want to edit text, ed is my shell.

    I love the way your text is formatted. Lumin, how have you formatted
    the text above? :-) .

    I do use GNU Emacs, and I think you made a good argument for 'ed' in me.
    If anyone here know how to format like the text above, but in GNU Emacs,
    I would like to know how.

    Daniel wrote that he uses a program called "par" to format his texts.
    You should be able to use it in emacs, too. Just mark your text and
    type

    C-u M-| par <ENTER>

    assumed "par" is installed on your system.

    Actually, 'par' is not giving good results, so I stopped using it (it
    was recommended to me) and, by contrast, I started using C-u M-q on a
    middle of a paragraph text, to do the job I was trying to achieve with
    'par'.

    M-q is the 'fill-paragraph' function. With a prefix (C-u before the
    call) it justifies and fills the paragraph.

    =2D-=20
    A little Consideration, a little Thought for Others, makes
    all the difference. ~ Alan Alexander Milne

    --=-=-=
    Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQJmBAEBCgBQFiEEOVeKaEm0xBhCsMmYlk/BEMQK1XUFAmpG+nYbFIAAAAAABAAO bWFudTIsMi41KzEuMTEsMiwyFhxkYW4ubGlzdEBsaXNwY2x1Yi5jb20ACgkQlk/B EMQK1XWAQxAAjAyy9y2TjhAOvAWgXUYLa3N8gdzCx6zPEa5btPD5g0XaxQaF59BU PabCPER53dwXH2IdTX/jVszuLCuPyks3ILvz8VR2WTkb5zBa2OS7zLg4ZoV9rYmX Ft30OCg3k7qA9w4rNIskVUi74UbBRJ7SS71ukr+SxCXk8DUwwEYCG7HmOOqvMOok LusGdUZ5/T2v1u32L/Aj+6G1StVS1kygGRws2MFkFOq88fv1vzSs3079D3u9uUDC DIhYhyq108T5jYwm8uf/wTHiPBJS5j+XSaWUrylSUfl0vISCu6TCZ8HvkbsGBT5G YB6f0SVBd0hbEY1tj464DqGwm3C4TS1YXHiPWnKzQiIcT96Oy6q5An9YGHxRI23U UispZ4HrqEyLXEMVm9VuhDHYOhw2Ugy6HIPcG8ehNy+oCPZquM3kN7sGNyE/TJjc E1JlP4+9f6uWvCE5160lZgevRl3x4B1nK9wq0qzxu5hcXz6uytW1KYz4llI1vGOY hk/XthxLKHW4CTD3VUQXGQPpDDEfxw5tlUfDF3N99NkGzeei4gkucsh9j6fLJal0 CaV7Haos/5bce/k3/GaJKbsF49VgS3T6Kqjfk4um1hDG98tJ+Q6w2D1/TY5ikREO Fs3eYkaULNVWaPR0ReAUhHEG/1ITWMJnZgk9Hh/1NmrcdZk70fNGm0w=
    =Gkbr
    -----END PGP SIGNATURE-----
    --=-=-=--
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.unix.shell on Thu Jul 2 20:30:29 2026
    Daniel Cerqueira <dan.list@lispclub.com> writes:
    [...]
    Actually, 'par' is not giving good results, so I stopped using it (it
    was recommended to me) and, by contrast, I started using C-u M-q on a middle of a paragraph text, to do the job I was trying to achieve with 'par'.

    M-q is the 'fill-paragraph' function. With a prefix (C-u before the call) it justifies and fills the paragraph.

    And the result is that your paragraphs have extra spaces inserted
    just to make the text both left- and right-justified.

    My advice is to drop the prefix and fill the paragraphs *without* right-justifying them. Right-justified lines are fine with
    variable-width fonts, but with fixed-width fonts I find them
    distracting and unhelpful. (Note that you are almost the only
    person who posts like this.)

    I know I've mentioned this before. I'm not planning to do so again.
    And thank you for left-justifying your text.
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */