v0.23.0 333c710

keys.templ RawHistoryFolder

1// SPDX-License-Identifier: AGPL-3.0-or-later
2
3package web
4
5// Keys is the keyboard map. ermite.js turns keys into k-<name> events on
6// <body>; this element is the only place that binds them, each to one call of
7// window.ermite (ermite.js), which does the work.
8templ Keys() {
9	<div
10		id="keys"
11		hidden
12		hx-on="k-j from:body -> ermite.move(1);
13         k-k from:body -> ermite.move(-1);
14         k-top from:body -> ermite.edge(false);
15         k-bottom from:body -> ermite.edge(true);
16         k-open from:body -> ermite.open();
17         k-right from:body -> ermite.rail(true);
18         k-left from:body -> ermite.rail(false);
19         k-esc from:body -> ermite.closeDialogs();
20         k-help from:body -> ermite.dialog('panel-help');
21         k-refs from:body -> ermite.dialog('panel-refs', 'refs-filter');
22         k-cmd from:body -> ermite.dialog('panel-cmd', 'cmd-q'); ermiteFinder.load();
23         k-filter from:body -> ermite.focusFilter();
24         k-gh from:body -> ermite.go('.brand');
25         k-s from:body -> ermite.tab('s');
26         k-t from:body -> ermite.tab('t');
27         k-c from:body -> ermite.tab('c');
28         k-r from:body -> ermite.tab('r');
29         k-m from:body -> ermite.tab('m');
30         k-next from:body -> ermite.nextNote();
31         k-split from:body -> ermite.layout('split');
32         k-unified from:body -> ermite.layout('unified');
33         k-collapse from:body -> ermite.collapse();
34         k-expand from:body -> ermite.expandFile();
35         k-expandAll from:body -> ermite.expandAll();
36         k-permalink from:body -> ermite.permalink();
37         k-merge from:body -> window.ermiteMR?.openMerge();
38         k-read from:body -> window.ermiteMR?.markRead();
39         k-gf from:body -> window.ermiteMR?.focusFiles();
40         k-keys from:body -> ermite.toggleKeys()"
41	></div>
42}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 45

↑↓ moveenter openesc close