10

Basically, I'd want to achieve some sort of automatic line breaking in a text editor on Linux; I'm pretty sure it exists, but I don't know how it's called. Let's say the facility allows you to specify a prefix string *> , a suffix string <, and a character width/column break specification (break at line 30). Then, each time text is about to break, suffix is inserted, then line break, then prefix, and typing can continue.

Being difficult to explain, I took screenshots while I typed key after key in Scite, and produced this gif animation - the line supposed to simulate setting of a (right) margin at 30 characters:

sctextbreak15-O2.gif

Now, what I would like is that the text editors preserves the margins, even if I'm with the cursor in an already existing portion of a text formatted that way, and I either type and add new characters, or decide to delete old ones. Of course, that would mostly be used to format automatically text like C-style code comments and such (but could also be used for ASCII art); but I'd like arbitrary prefix and suffix (so I can change them if I want, say if I code Latex).

Any such software that can do this on Linux?

2

1 Answer 1

2

At one point there was par otherwise known as par (42 was the version number) It was clever enough that you could reformat nested email quoted messages and do the right thing. Settable margins, prefixes, postfixes.

At one point I had par commands to turn the paragraph above into this:

###########################################################################
#  At one point there was par42 otherwise known as par  (42 was the ver-  #
#  sion number)  It was clever enough that you could reformat nested e-   #
#  mail quoted messages and do the right thing.  Settable margins, pre-   #
#  fixes, postfixes.                                                      #
###########################################################################

As I recall it was very plain C code, a few hundred lines, rather opaque, and by default read from STDIn, and wrote to STDout.

Here's the official website: http://www.nicemice.net/par/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.