How-to guides
Recipes for tasks you already have in mind, each covering one task from start to finish, from installing aless to using a grammar of your own.
Each guide solves one task. It assumes that aless is installed and that you can use a terminal. Each guide links to the Command line page for the options the guide uses, and to the Keys page for the keys the guide names.
The guides are in three groups: setting aless up, reading a document once it is open, and working with the files and formats aless reads. If you have not used aless before, start with the Tutorials page.
Setting up #
Install aless on your machine, set up its completions and its man page, and learn what each platform needs of a terminal.
- Install alessInstall aless on Linux, macOS, or Windows with its installer, Homebrew, or Cargo, and check what you downloaded.
- Set up completions and the man pageHave your shell complete the options of aless and their values, and man show the aless man page, however you installed aless.
- Run aless on Linux, macOS, and WindowsLearn what the viewer needs from a terminal on each platform, what differs on Windows, and what to do over SSH, in a container, or inside tmux.
Reading a document #
Once a document is open in the viewer, search it, copy from it, choose how the viewer draws it, and write it out as JSON.
- Search a documentFind a value, a key, or a pattern with a regular expression, move between the matches, and learn which text the search reads.
- Copy a value or its pathCopy the focused node's value, key, or path, on a desktop or over SSH, or print it on screen to read.
- Choose how the viewer draws a documentChoose between data mode and line mode, number the rows, set the indentation and the scrolling, fold a document as it opens, and change the fold markers, the colour, and the mouse, when aless starts or from inside it.
- Save a document as JSONWrite the document in a tab to a file as JSON, whatever format the tab is read from, print a file's tree as JSON from the shell, or copy one value of the document as JSON.
Files and formats #
Follow a file as it changes, open several files, browse a directory, choose the format aless reads, find out why a file does not parse, and read a format of your own.
- Follow a file as it changesKeep a file open in the viewer while the file is written, rewritten, or regenerated, with your place kept on each reload, and stop following the file when you want the document on screen left as it is.
- Compare the versions of a fileSee what each save of a watched file changed, step back through the versions aless keeps, list them in the history tab, and keep one version as a file.
- Open several files in tabsOpen several files at once, each in a tab of its own, move between the tabs, and open and close tabs from inside aless.
- Browse a directoryOpen a directory as a tree in the viewer, find a file in the tree, and open that file in a tab.
- Choose the format aless readsName the format for a file whose name does not say which format it holds, or for standard input, and read a tab again as another format.
- Find out why a file does not parseRead the report aless shows for a file that does not parse, see it full size, find the line in the source view, and get the document back.
- Read a format aless does not knowDescribe a line-oriented text format in ABNF, name the grammar on the command line, and open its files in the viewer as you open the files of a built-in format.