A fast, format-aware semantic line break formatter for academic papers and collaborative writing.
Traditional wrapping hides changes in paragraph-wide diffs. Snapper breaks at sentence boundaries so every edit shows exactly what changed.
Everything you need to adopt semantic line breaks across your paper writing toolchain.
Understands Org-mode, LaTeX, Markdown, RST, and plaintext. Code blocks, math environments, tables, directives, and drawers pass through untouched.
Handles Dr., Fig., Eq., e.g., i.e., et al. and 80+ more. Add project-specific abbreviations via .snapperrc.toml.
Ships with .pre-commit-hooks.yaml. Enforce semantic line breaks automatically on every commit across your team.
Stdin/stdout interface works with Emacs Apheleia, vim, and any editor that supports external formatters. Format on save.
Bundled vale rules flag lines with multiple sentences in your editor. Use --check for precise CI enforcement.
Auto-format on commit, transparent to collaborators. Add to .gitattributes and formatting happens silently.
Optional ML-based splitting via nnsplit for 9 languages. Use --neural --lang de for non-English text where rules fall short.
Mark hand-formatted text with snapper:off / snapper:on comments. Poetry, aligned text, and ASCII art pass through untouched.
snapper init detects your formats and generates config, pre-commit hooks, gitattributes, and editor snippets.
# pre-built binary (fastest) cargo binstall snapper-fmt # or compile from source cargo install snapper-fmt
# one-liner (Linux/macOS) curl -LsSf https://github.com/TurtleTech-ehf/snapper/releases/latest/download/snapper-fmt-installer.sh | sh # or Homebrew brew install TurtleTech-ehf/tap/snapper-fmt
# pip (with maturin wheels) pip install snapper-fmt # Nix nix build github:TurtleTech-ehf/snapper
# .pre-commit-config.yaml - repo: https://github.com/TurtleTech-ehf/snapper rev: v0.3.2 hooks: - id: snapper