Skip to main content

überfmt

Überfmt formats paragraphs of plain text so that each line is close to the optimal length. It is an upgrade over GNU fmt and BSD fmt in that it supports Unicode and automatically recognizes comment-like formatting.

For example überfmt will translate this badly formatted fragment of text:

/* Lorem ipsum dolor sit amet,
 * consectetur adipiscing elit. Aliquam placerat faucibus
 * luctus. Donec dolor lorem.
 */

into the following, all while preserving the comment structure:

/* Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Aliquam placerat faucibus luctus. Donec dolor lorem.
 */

Überfmt is language-agnostic and will work equally well for most conventionally-formatted comment styles: C, Shell, Pascal, everything goes.

How to use?

Pipe your text into the standard input of the uberfmt command, collect the formatted text on the output.

The author also uses the following Vim shortcuts:

nmap \f vap!uberfmt<CR>
vmap \f !uberfmt<CR>

This way pressing \f inside a paragraph (or after selecting a fragment of text) will reformat it with uberfmt.

How to install?

Install it from PyPI:

python3 -m pip install --user --upgrade uberfmt

This should place a small script into your ~/.local/bin folder, and if it is in your PATH, you should be able to use uberfmt right away.

Alternatively just download uberfmt from Github; it’s a single file program.

Metadata

Release files for uberfmt 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uberfmt 0.2
File Size Uploaded Provenance Actions
uberfmt-0.2.tar.gz 2.7 kB Without provenance Details for uberfmt-0.2.tar.gz

Release files / uberfmt-0.2.tar.gz

Download URL uberfmt-0.2.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d98e08d354cad517677947272e7ba0ae2a93b7135072f0f6a82122375a4b093
BLAKE2b-256 checksum
How to use checksums
c6a298de96d0851db7fca91d05febf07893dbeaa24c669edae424268eac4855b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.12

Security for uberfmt 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page