Windows and the sidebar

The screen holds up to four regions:

  • the main editor region, where you write;
  • a second editor region below it, when you split;
  • the left sidebar;
  • the right sidebar.

Editor regions and sidebars are moved between, opened and closed with one group of keys. The group has two doors, C-w and Space w, with the same letters after either, as in helix.

Region keys

KeyAction
C-w wgo to the next open region
C-w h C-w lgo to the left / right sidebar, if it is open
C-w k C-w jgo to the main / second editor region, if it is open
C-w e C-w iopen or close the left / right sidebar; the keys stay where they are
C-w E C-w Iopen the left / right sidebar and go into it
C-w s C-w vsplit: open the second editor region and go there
C-w qclose the region you are in
C-w okeep only this editor region; close the rest

You can keep Ctrl held: C-w C-w is the same as C-w w, and so on for the other letters. The arrow keys work in place of h j k l.

Going and opening are separate. C-w w and C-w h j k l only move among regions that are open; where nothing is open, they do nothing. To open a sidebar use C-w e or C-w E, and to open a second editor region use C-w s.

Lower case leaves the keys where they are. C-w e folds the left sidebar away or brings it back while you keep typing in the text. Upper case C-w E opens the sidebar and moves into it, and never closes it.

C-w q in the only region left does nothing but say so: closing it would mean leaving, and that is :q.

The second editor region

C-w s opens a second editor region below the first, showing the same file. C-w j and C-w k move between the two, and C-w q closes the one you are in. :q does the same while the window is split: it closes this region and leaves the file open, changes and all. In the last region :q works as usual (see Saving and quitting).

Some commands use this region to show you something without moving you:

C-w v does the same as C-w s for now: the second region always sits below the first.

There is one sidebar on each side, and each holds one panel at a time. The left sidebar holds four panels, and Tab steps through them:

PanelShowsOpened with
Explorerthe project's files, as a tree:sidebar explorer
Buffersthe open files; a changed one is marked +:sidebar buffers
Outlinethe headings of the current fileSpace s, :sidebar outline
Searchthe search panelSpace /, :sidebar search

The right sidebar holds one panel, Info, described below.

:sidebar on its own says what is open, :sidebar off closes both, and :sidebar info opens the right one. Space e and Space f are pickers, not the Explorer panel; see Pickers.

Keys in a sidebar

When a sidebar has the keys, the status line lists the keys it takes, including how to get back.

KeyAction
j kdown / up a row
J Kdown / up twelve rows (also PageDown PageUp)
g Gthe first / last row
hfold a folder or heading
l Enteropen: a folder, a file, a heading, a buffer
Tab S-Tabthe next / previous panel on this side
wmake this sidebar wider, one step
qgive the keys back to the text; the sidebar stays open
C-wthe region keys, as in the text
: Spacethe command line and the Space menu, as in the text

q and C-w w both leave the sidebar without closing it. The way to close it is C-w q (or C-w e / C-w i). Esc does not close a sidebar: it is kept for leaving a box you are typing in.

Choosing a file or a heading with Enter takes you there and gives the keys back to the text.

The frame

A sidebar that has the keys is framed in a double gold line. One that does not has a thin grey frame. The panel's name is on the top edge. When a side holds more than one panel, the bottom edge lists them in the order Tab walks, for example Tab Explorer>Buffers>Outline>Search.

Width

w in a sidebar steps its width through four sizes: 2/10, 3/10, 4/10 and 5/10 of the window, then back to 2/10. The default is 3/10. The status line shows the fraction after each press.

The width belongs to the side, not to the panel. Switching panels with Tab, or closing and reopening the sidebar, keeps it.

The text always keeps at least a third of the window, and never less than 24 columns. When both sidebars are open on a small window they shrink together to make room; they grow back to the width you chose when the window widens. A window narrower than 36 columns has no room for a sidebar at all.

The outline: Space s

Space s asks for the outline, and what it does depends on where you are:

  • sidebar closed: open it on the outline and go in;
  • open on another panel: switch to the outline;
  • open on the outline, keys in the text: go back into it;
  • already in the outline: close it.

From a closed sidebar, pressing Space s twice brings you back to where you started; from any other state the second press closes the sidebar.

The outline lists Markdown headings (# followed by a space) and Typst headings (=). In a text file it shows at the right edge how much each heading's section holds, its subsections included. h folds the sections under a heading and l opens them again; h on a heading with nothing under it folds its parent. In a Typst file, the outline also reads the files the document #includes, and Enter on one of their headings opens that file.

The Info panel

The right sidebar holds one panel, Info, which shows one kind of answer at a time about what is under the cursor. Its title says which one it is showing. Each kind has a lower-case key that floats a small window beside the text and an upper-case key that puts the same answer in the sidebar:

KindFloatSidebar
dictionary: the character's decomposition, readings, code pointSpace nSpace N
documentation from the language serverSpace kSpace K
diagnosticsSpace dSpace D
the change here: what this block was beforeSpace xSpace X
the record (table row details)Space iSpace I
the wiki entry for the name under the cursor:wiki-panel

None of these take the keys: the cursor stays in the text and you keep typing. When an answer is too long to read at a glance, C-w w walks into the sidebar, and j k J K g G scroll it. In the change view, u puts back what the block was before and y copies the old text.

A dictionary answer is about the character you asked about. Move the cursor off it and the answer goes away.