docs/src/commands.md
69 lines · 1999 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]
44```
45
46> The `flush` command is used to run all tasks in queue immediately, this is usually done automatically.
47>
48> 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.
49
50## Text commands
51
52Text commands generates a *text only response* without launching the TUI.
53
54```vim
55help
56version
57```
58
59## Command bindings
60
61Commands can be binded to keys just like normal key bindings, bindings can be edited in `commandbindings.yml`. Below are the default bindings:
62
63|Key|Description|
64|---|---|
65|`Ctrl + F`|Open page in browser|
66|`Ctrl + C`|Copy page url|
67|`Ctrl + P`|Play hovered video|
68|`Ctrl + A`|Play hovered audio|
69|`Shift + A`|Play hovered audio on repeat (shuffled if hovering a playlist)|