Files
dotfiles/.config/television/cable/text.toml
2026-03-25 16:31:17 +01:00

30 lines
848 B
TOML

[metadata]
name = "text"
description = "A channel to find and select text from files"
requirements = ["rg", "batcat"]
[source]
command = [
"rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always",
"rg . --no-heading --line-number --hidden --colors 'match:fg:white' --colors 'path:fg:blue' --color=always",
]
ansi = true
output = "'+{strip_ansi|split:\\::1}' '{strip_ansi|split:\\::0}'"
[preview]
command = "batcat -n --color=always '{strip_ansi|split:\\::0}'"
env = { BAT_THEME = "ansi" }
offset = '{strip_ansi|split:\::1}'
[ui]
preview_panel = { header = '{strip_ansi|split:\::..2}' }
[keybindings]
ctrl-e = "actions:edit"
[actions.edit]
description = "Open file in editor at line"
command = "${EDITOR:-vim} '+{strip_ansi|split:\\::1}' '{strip_ansi|split:\\::0}'"
shell = "bash"
mode = "execute"