git.y1.nz

lwl

Less with links.
download: http://git.y1.nz/archives/lwl.tar.gz
README | Files | Log | Refs

lwl.1

      1 .Dd July 12, 2026
      2 .Dt LWL 1
      3 .Os
      4 .Sh NAME
      5 .Nm lwl
      6 .Nd """less with links"""
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl p Ar placeholder
     10 .Ar FILENAME
     11 .Sh DESCRIPTION
     12 .Nm
     13 displays the contents of
     14 .Ar FILENAME
     15 in the terminal nearly identically to
     16 .Xr less 1 .
     17 The behavior of less and
     18 .Nm
     19 diverge in minor ways, mostly for interacting with markdown-style links.
     20 This document assumes a working understanding of less and so focuses mostly on
     21 where
     22 .Nm
     23 is different.
     24 .Pp
     25 .Nm
     26 is configured by editing its source code (especially
     27 .In config.h )
     28 and then recompiling. For simplicity, this man page only describes the default
     29 configuration. It is intended that the source code of this program is part of the
     30 user's experience, if she wishes to change the program's behavior in any way.
     31 .Sh SPECIAL CHARACTERS
     32 .Nm
     33 only supports the ascii encoding. Accordingly, it handles non-printable,
     34 non-whitespace bytes by displaying them highlighted in red, as a period followed
     35 by their two-digit hexadecimal representation. For example, a null character
     36 ('\\0') would appear like ".00". This behavior is defined in
     37 .In draw.c .
     38 .Sh LINKS
     39 .Nm
     40 recognizes markdown-like links, of the form
     41 .Bl -tag -width Ds
     42 .It
     43 [link text](destination)
     44 .El
     45 .Pp
     46 in the text it is given. The characters (, ), [, and ] may be escaped by a
     47 preceding backslash, in which case the backslash is omitted from the output.
     48 The escaped character is ignored in the detection of links. The square-bracketed
     49 section of a link may contain other links.
     50 
     51 In the displayed text, links retain their square brackets, but their parenthetical
     52 section is hidden. The square-bracket section is shown in bold blue text. The
     53 currently "selected" link is displayed with a blue background and bold black text.
     54 
     55 You can select the next or previous link using 'n' or 'N' respectively. 'm' and 'M'
     56 can be used to step 8 links at a time. If the selected link is offscreen, any
     57 link-navigation will select either the first or last link onscreen, depending on
     58 the direction of the attempted step. After any link-based navigation, the text
     59 between the parentheses of the selected link will be displayed at the bottom of
     60 the screen.
     61 
     62 \'v' can be used to view the entire text of a long link.
     63 .Sh TEXT-SEARCH
     64 Navigating between text-search results utilizes the same controls and graphical
     65 rendition, but with green instead of blue. Pressing backspace in search mode with
     66 no characters in the buffer will return
     67 .Nm
     68 to normal mode.
     69 
     70 Running an empty search (via '/' '\\n' from normal mode) or running a search
     71 that yields no matches resets the selected link and goes back to link-navigation
     72 after a text-search.
     73 
     74 .Sh COMMANDS
     75 .Nm
     76 adds certain shell-like behaviors. From normal mode, '>' can be used to execute a
     77 command by forking and then executing "exec -c <command>". '!' functions
     78 similarly but does not fork (meaning the entire program will close once the
     79 command terminates). Before either command,
     80 .Nm
     81 sets the environment variable LINK to the text between the parentheses of the
     82 selected link. Note that the USER is responsible for appropriately vetting links,
     83 which may contain malicious text. The following are some example uses for this
     84 feature:
     85 
     86 .Bl -tag -width Ds
     87 .It
     88 >echo "[cool page about bugs]($LINK)" >> ~/bookmarks
     89 .It
     90 >echo "$LINK" >> document && vi document
     91 (appending a link to a document you are editing, useful for systems without support for copy-paste)
     92 .El
     93 
     94 .Pp
     95 rababa
     96 .El
     97 .Sh EXIT STATUS
     98 .Ex -std
     99 .Sh SEE ALSO
    100 .Xr less 1
    101 .Xr bro 1
    102 .Xr digest 1
    103 .Xr 
    104 .Sh AUTHORS
    105 .An Emma Weaver Aq Mt emma@y1.nz

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.