Skip to content

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Refold

refold is a commandline tool for performing text-wrapping, similar to unix fold. Unlike fold, refold will recombine lines before performing line-wrapping, and it will automatically detect line prefixes.

Comparison to fold

refoldunix fold
RewrappingYesNo
Line prefix supportYesNo
Line endingsLF and can auto detect CRLFLF only
Default wrappingSoft via Unicode splittable propertyHard
Hard wrappingYesYes
Soft wrappingYesYes*

*: fold leaves trailing spaces and can only split ASCII space-separated words.

Example:

refold --spaces --width=100:

/// I'd just like to interject for a moment. What you're refering to as Linux, is in fact, GNU/Linux,
/// or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the
/// GNU corelibs, shell utilities
/// and vital system components comprising a full OS as defined by POSIX.

->

/// I'd just like to interject for a moment. What you're refering to as Linux, is in fact,
/// GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating
/// system unto itself, but rather another free component of a fully functioning GNU system made
/// useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as
/// defined by POSIX.

Installing

Cargo (most platforms)

  1. Install Cargo.
  2. Run cargo install refold.

Binaries

Binaries for arm64 and x86_64 can be found in the releases section of the github.

These are statically linked, so they should run on pretty much any linux distribution including NixOS and Alpine.

Additionally, these binaries are packaged in the following formats:

  • APK
  • DEB
  • RPM

Nix

Alternatively, a Nix package can be found in the releases section. Unfortunately, refold will not be updated automatically when using this method.

  1. Download refold.nixfrom the Releases page.
  2. Add (pkgs.callPackage /PATH/TO/REFOLD.NIX {}) to your configuration.nix file under environment.systemPackages, users.users.YOUR_USERNAME.packages, or in any other place that you can list packages.

About

A commandline tool for performing text-wrapping

Topics

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages