summaryrefslogtreecommitdiff
path: root/ar/.config/television/cable/man-pages.toml
blob: 38c3e676cdf9fa8abb06b3058cc115d7b2c11e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[metadata]
name = "man-pages"
description = "Browse and preview system manual pages"
requirements = ["man", "apropos", "col", "bat"]

[source]
command = "man -k ."

[ui]
layout = "landscape"

[ui.preview_panel]
header = "{0}"

[keybindings]
ctrl-b = "actions:bat"
ctrl-v = "actions:nvim"

[preview]
command = "sh -c \"man $(echo {0} | sed -E 's/^([^ ]+) \\(([^)]+)\\).*/\\2 \\1/') | col -bx | bat -l man -p --color=always\""

[preview.env]
MANWIDTH = "80"
MANPAGER = "cat"
PAGER = "cat"

[actions.bat]
description = "View with bat"
command = "echo '{0}' | sed -E 's/^([^ ]+) \\(([^)]+)\\).*/\\2 \\1/' | xargs -r man | col -bx | bat -l man -p"
mode = "fork"

[actions.nvim]
description = "Open in Neovim"
command = "echo '{0}' | sed -E 's/^([^ ]+) \\(([^)]+)\\).*/\\2 \\1/' | xargs -r man | nvim -"
mode = "fork"