#!/bin/sh # # view - view long text files comfortably # # SPDX-FileCopyrightText: 2023 Daniel Kalak # SPDX-License-Identifier: GPL-3.0-or-later # # Advantages: # # 1. Like "cat", the script takes one or more file names as arguments or # reads from stdin. # # 2. Long lines (e.g. single-line paragraphs in Gemtext) are wrapped at # spaces to be at most 80 characters wide. # # 3. Separate lines are not joined to form "paragraphs". This leaves # hard-wrapped paragraphs (with line lengths of at most 80) as-is and # doesn't mess up poetry or other verse-based content. # # 4. The resulting lines are numbered for ease of orientation and # referencing. # # 5. The result is left un-paginated (unlike with "pr") to allow for # continous scrolling. cat "$@" | fold -s | less -N