v0.33.1 9577fee

vim_page_interaction.go RawHistoryFolder

1package dto
2
3// VimPageInteractionKind identifies an in-page Vim Mode interaction such as
4// link hints, visual selection, or a one-shot text-object yank.
5type VimPageInteractionKind int
6
7const (
8	// VimPageHintFollow labels visible clickable elements and activates the chosen one.
9	VimPageHintFollow VimPageInteractionKind = iota + 1
10	// VimPageHintFollowNew labels visible links and opens the chosen one in a new pane.
11	VimPageHintFollowNew
12	// VimPageHintYankURL labels visible links and copies the chosen URL.
13	VimPageHintYankURL
14	// VimPageVisual starts the caret and visual selection flow: text-anchor
15	// hints, a caret that motions move, and charwise or linewise selections
16	// that y copies without leaving the caret.
17	VimPageVisual
18	// VimPageYankObject copies one structural text object immediately.
19	VimPageYankObject
20)
21
22// CapturesKeys reports whether the interaction consumes page keys until the
23// page reports its end. One-shot yanks complete without key capture.
24func (k VimPageInteractionKind) CapturesKeys() bool {
25	switch k {
26	case VimPageHintFollow, VimPageHintFollowNew, VimPageHintYankURL, VimPageVisual:
27		return true
28	default:
29		return false
30	}
31}
32
33// VimPageMode is the sub-mode a key-capturing page interaction reports as it
34// moves between states, so the UI can label it.
35type VimPageMode string
36
37const (
38	// VimPageModeHints is showing text-anchor hints to place the caret.
39	VimPageModeHints VimPageMode = "hints"
40	// VimPageModeCaret is moving a visible caret without selecting.
41	VimPageModeCaret VimPageMode = "caret"
42	// VimPageModeVisual is extending a charwise selection.
43	VimPageModeVisual VimPageMode = "visual"
44	// VimPageModeVisualLine is extending a linewise selection.
45	VimPageModeVisualLine VimPageMode = "visual-line"
46)
47
48// Valid reports whether the mode is one the page runtime may report.
49func (m VimPageMode) Valid() bool {
50	switch m {
51	case VimPageModeHints, VimPageModeCaret, VimPageModeVisual, VimPageModeVisualLine:
52		return true
53	default:
54		return false
55	}
56}
57
58// VimPageTextObject identifies the structural block copied by a text-object yank.
59type VimPageTextObject int
60
61const (
62	VimPageTextObjectSection VimPageTextObject = iota + 1
63	VimPageTextObjectParagraph
64	VimPageTextObjectCode
65	VimPageTextObjectTable
66	VimPageTextObjectList
67)
68
69// VimPageInteractionRequest describes one in-page Vim interaction.
70type VimPageInteractionRequest struct {
71	Kind           VimPageInteractionKind
72	Object         VimPageTextObject
73	HighlightColor string
74}
75
76// VimNavigationOutcome tells the UI how to continue after a Vim action.
77type VimNavigationOutcome struct {
78	// CapturePageKeys asks the UI to forward keys to the page interaction until
79	// the page reports that the interaction ended.
80	CapturePageKeys bool
81	// PageKind and PageMode name the key-capturing interaction and the
82	// sub-mode it starts in, so the UI labels it without knowing actions.
83	// Both are zero when CapturePageKeys is false.
84	PageKind VimPageInteractionKind
85	PageMode VimPageMode
86}

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 8

Tags 42

↑↓ moveenter openesc close