docs/src/commands.md
83 lines · 2531 bytes
1# Commands
2
3Commands can be entered to the TUI by pressing the `:` key, the same as in Vim. Some commands have shorter *alternatives* that can be used instead.
4
5> Env variables can be used by passing in as `${key}`, such as `:channel ${channel-id}` when in a video or playlist page.
6
7**Loadpage commands** can also be used when launching, for example `youtube-tui loadpage popular` or `youtube-tui popular`.
8
9> Commands can be joined together using `;;`.
10
11Below are the avaliable commands:
12
13## Loadpage
14
15`loadpage` can be used to load a specific page.
16
17```vim
18loadpage popular (alt: `popular`)
19loadpage trending (alt: `trending`)
20loadpage watchhistory (alt: `watchhistory`)
21loadpage search [search query] (alt: `search [search query]`)
22loadpage video [id or url] (alt: `video [id or url]`)
23loadpage playlist [id or url] (alt: `playlist [id or url] `)
24loadpage channel [id or url] (alt: `channel [id or url] `)
25```
26
27## History
28
29`history` is used to manage page history (`Backspace` equivalent).
30
31```vim
32history back (alt: `back`)
33history clear
34```
35
36## Utility
37
38```vim
39reload (alt `r`)
40reload configs (alt `reload/r config/configs`)
41flush
42quit (alt `q`, `exit`, `x`)
43run [command]
44parrun [command]
45```
46
47> The `flush` command is used to run all tasks in queue immediately, this is usually done automatically.
48>
49> But for when tasks are stacked up in the *same* event loop and the order of which they are executed matters, this command can be used to force the already stacked up commands to be ran first.
50
51> `run` is used for running *blocking commands*, while `parrun` is non-blocking.
52
53## Library
54
55```vim
56bookmark [id] Bookmark item with ID (item must be already loaded)
57unmark [id] Remove bookmark item with ID
58togglemark [id] Toggle bookmark status
59sub/sync [id or url] Add channel to subscription, or sync an existing channel
60unsub [id or url] Remove channel from subscription
61syncall Sync all subscriptions
62```
63
64## Text commands
65
66Text commands generates a *text only response* without launching the TUI.
67
68```vim
69help
70version
71```
72
73## Command bindings
74
75Commands can be binded to keys just like normal key bindings, bindings can be edited in `commandbindings.yml`. Below are the default bindings:
76
77|Key|Description|
78|---|---|
79|`Ctrl + F`|Open page in browser|
80|`Ctrl + C`|Copy page url|
81|`Ctrl + P`|Play hovered video|
82|`Ctrl + A`|Play hovered audio|
83|`Shift + A`|Play hovered audio on repeat (shuffled if hovering a playlist)|