Gnu less: Difference between revisions

From wikinotes
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
<blockquote>
<blockquote>
{| class="wikitable"
{| class="wikitable"
|-
| <code>man less</code> || https://man.archlinux.org/man/less.1
|-
| <code>man lesskey</code> || https://man.archlinux.org/man/core/less/lesskey.1.en
|-
|-
| github || https://github.com/gwsw/less
| github || https://github.com/gwsw/less
Line 9: Line 13:
|}
|}
</blockquote><!-- Documentation -->
</blockquote><!-- Documentation -->
= Locations =
<blockquote>
{| class="wikitable"
|-
| <code>${XDG_CONFIG_HOME}/.lesskey</code> || custom keybindings
|-
|}
</blockquote><!-- Locations -->
= Usage =
<blockquote>
Common params
<syntaxhighlight lang="bash">
less \
  -X `# skip de-initialization (leave text onscreen at exit)`
  -R `# raw control chars (include colours)` \
  -S `# chop lines wider than terminal can display (scroll w/ arrowkeys)` \
  -F `# only use pager if terminal not tall enough for all text` \
  +F `# tail output, only use pager if terminal not tall enough for all text` \
  -i `# ignore case` \
  \
  --mouse        `# enable scrolling with mouse` \
  --wheel-lines=5 `# number of lines scrolled each mousewheel click` \
</syntaxhighlight>
</blockquote><!-- Usage -->


= Configuration =
= Configuration =
<blockquote>
<blockquote>
== Environment ==
<blockquote>
<syntaxhighlight lang="bash">
LESS="XRF"  # default less params -X, -R, -F
</syntaxhighlight>
</blockquote><!-- Environment -->
== Colours ==
== Colours ==
<blockquote>
<blockquote>

Latest revision as of 22:30, 10 December 2022

A pager for unix systems.

Documentation

man less https://man.archlinux.org/man/less.1
man lesskey https://man.archlinux.org/man/core/less/lesskey.1.en
github https://github.com/gwsw/less

Locations

${XDG_CONFIG_HOME}/.lesskey custom keybindings

Usage

Common params

less \
  -X `# skip de-initialization (leave text onscreen at exit)`
  -R `# raw control chars (include colours)` \
  -S `# chop lines wider than terminal can display (scroll w/ arrowkeys)` \
  -F `# only use pager if terminal not tall enough for all text` \
  +F `# tail output, only use pager if terminal not tall enough for all text` \
  -i `# ignore case` \
  \
  --mouse         `# enable scrolling with mouse` \
  --wheel-lines=5 `# number of lines scrolled each mousewheel click` \

Configuration

Environment

LESS="XRF"  # default less params -X, -R, -F

Colours

less colours can be controlled via $LESS_TERMCAP_* environment variables.
See https://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables