Keys

Every key, command, and setting of the viewer, as F1 lists them inside aless.

To see this list inside aless, press F1 or type :help. Where jless has a key for an action, aless uses the same key. The same list is also in the plain-text file keys.txt, as the terminal shows it.

Moving #

A count before a key repeats it: 3j moves down three rows.

KeysDoes
j k, ↓ ↑, Ctrl+N Ctrl+PMove down and up a row.
Enter BackspaceMove down and up a row, as j and k do.
h, ←Fold the focused container, or go to its parent.
l, →Unfold the focused container, or go to its first child.
HGo to the parent, and leave it unfolded.
J KGo to the next and the previous sibling, and stop at the last and the first.
w bGo forward and back to the next row at another depth.
0, ^Go to the first sibling.
$Go to the last sibling.
g, HomeGo to the first row. Ng goes to row N.
G, EndGo to the last row. NG goes to row N.
Ctrl+F Ctrl+B, PgDn PgUpMove a page down and up.
Ctrl+D Ctrl+UMove half a page down and up. A count sets the distance, and later presses keep it.
Ctrl+E Ctrl+YScroll a row down and up. The focus moves only to keep scrolloff rows between it and the edge.
zz zt zbPut the focused row at the centre, the top, or the bottom of the screen.
. ,Scroll a value longer than the screen a character right and left.
;Scroll a long value to its end, and back to its start.
EscDrop a count, or the first key of a two-key command.

Folding and views #

KeysDoes
SpaceFold or unfold the focused container.
cFold the focused node and its siblings.
CFold the focused node and its siblings, and everything inside them.
eUnfold the focused node and its siblings.
EUnfold the focused node and its siblings, and everything inside them.
mSwitch between data mode and line mode.
%Go between a container's opening and closing brackets, in line mode.
sShow the source view in place of the tree: the text aless read, at the focused node's line. Any key but the scrolling ones, :, and r goes back.
< >Indent each level one space less or more.

Versions of a watched file #

Each reload that parses is a version. Marks show what the version on screen changed from the one before: yellow for a changed value, green for a new one, a red count for removed ones, and rails from the root down to each change.

KeysDoes
[ ]Show the version before, and the version after, the one on screen. 3[ goes back three.
{ }Show the oldest version kept, and the newest.
d DGo to the next and the previous change, round the end of the document.
vList the versions in the history tab, the newest first.

A pattern is a regular expression. It ignores case unless it holds a capital letter or ends in /s. The characters [ ] { } match themselves.

KeysDoes
/ ?Search forward and backward. Enter with no pattern searches for the last pattern again.
n NGo to the next and the previous match, round the end of the document.
* #Search forward and backward for the focused node's key.

Copy and print #

y and a second key copy the text to the clipboard. p and the same second key print it on screen instead. pP prints the path, because pp prints the value.

KeysDoes
yy ppThe value, pretty-printed as JSON
yv pvThe value as JSON on one line
ys psA string's contents, without its quotes
yk pkThe key
yp pPThe path, as jless writes it: .a[0].b
yb pbThe path, with every step in brackets: ["a"][0]["b"]
yq pqThe path, as jq writes it

Tabs and files #

KeysDoes
Tab Shift+TabGo to the next and the previous tab.
qClose the tab. Closing the last tab quits.
Ctrl+CQuit.
rRead the file again now.
WStop or start watching the file.
!Show the parse error report full size. h and l pan a long line.
:Start a command, from the Commands list.
F1Show this help.
Ctrl+ZSuspend aless, on Unix.

The explorer #

A directory is a tree with the same keys. m, %, and s do nothing in it.

KeysDoes
EnterOpen the focused file in a new tab, or fold or unfold a directory.
-Go up: the parent directory becomes the root.
ypCopy the focused entry's path on disk.
/Search the entries listed so far: each row's name, size, and format.

The history tab #

v lists the versions of a watched file in a tab, the newest first, each with what it changed. The tab follows the file as it changes, and closes with the file's tab. :w and :ws write the focused version. m, %, and s do nothing in it.

KeysDoes
EnterOpen the focused version in a tab of its own, which is not watched, at the focused change.
vGo to the history tab from a version's own tab, or from the file's tab.

Commands #

Type : and the command, then Enter.

KeysDoes
:open PATH [FORMAT], :eOpen a file or a directory in a new tab.
:q, :closeClose the tab.
:qa, :quit, :exitQuit.
:tab NGo to tab N.
:tabnext, :tabprevGo to the next and the previous tab.
:tabfirst, :tablastGo to the first and the last tab.
:w FILEWrite the document to FILE as JSON, but not over a file that exists.
:w! FILEWrite the document to FILE as JSON, over a file that exists.
:ws FILEWrite the text of the version on screen to FILE, but not over a file that exists.
:ws! FILEWrite the text of the version on screen to FILE, over a file that exists.
:historyList the versions in the history tab.
:format FORMATRead the tab's text again as FORMAT.
:mode data, :mode lineSwitch to data mode or line mode.
:depth NOpen the first N levels, and fold every container below them.
:expandUnfold the focused node and its siblings, and everything inside them.
:collapseFold everything, and go to the first row.
:N, :line NGo to row N.
:reload, :e!Read the file again now.
:watch on, :watch offStart or stop watching the file.
:sourceShow the source view.
:errorShow the parse error report full size.
:cd DIRMake DIR the explorer's root. DIR is relative to the current root. In a document's tab, open DIR in a new explorer tab.
:explore [DIR]Open DIR, or the current directory, in a new explorer tab.
:set SETTINGChange a setting, from the Settings list.
:helpShow this help.

Settings #

Each follows :set, and one :set takes several.

KeysDoes
number, nonumber, number!Number the rows, or stop, or switch between the two. nu is the short form.
relativenumber, norelativenumber, relativenumber!Number each row by its distance from the focus, or stop, or switch between the two. rnu is the short form.
so=NKeep N rows between the focus and the edge of the screen.
indent=N, sw=NIndent N spaces a level, at most 16.
ascii, noasciiDraw the fold markers as v and >, or as ▼ ▽ ▶ ▷.
hidden, nohidden, hidden!Show dot-files in the explorer, or hide them, or switch between the two.
watch, nowatchStart or stop watching the file.
changes, nochanges, changes!Mark what each version changed, or stop, or switch between the two.
history=NKeep up to N versions of each file, and fewer of a large one. The version on screen and the newest always stay.
mode=data, mode=lineSwitch to data mode or line mode.
depth=NOpen the first N levels, and fold every container below them.

Typing a command or a pattern #

KeysDoes
EnterRun the command, or search for the pattern.
Esc, Ctrl+CLeave without running the command or the search.
Backspace, Ctrl+H, DeleteDelete the character before or under the cursor.
← →, Ctrl+B Ctrl+FMove the cursor a character.
Home End, Ctrl+A Ctrl+EMove the cursor to the start or the end.
Ctrl+U, Ctrl+K, Ctrl+WDelete to the start, to the end, or the word before the cursor.

This help, the error report, and printed text #

Any other key goes back to the document.

KeysDoes
j k, ↓ ↑Scroll a line.
Ctrl+D Ctrl+U, Ctrl+F Ctrl+B, PgDn PgUpScroll a page.
g G, Home EndGo to the first and the last line.
h l, ← →Pan a line wider than the screen.

This page describes aless 0.8.0. Written from src/app.rs · This page as Markdown