Skip to content

Instantly share code, notes, and snippets.

@pierodev0
Created February 28, 2026 21:46
Show Gist options
  • Select an option

  • Save pierodev0/61f660acaaf58b7020bc5e8c55222146 to your computer and use it in GitHub Desktop.

Select an option

Save pierodev0/61f660acaaf58b7020bc5e8c55222146 to your computer and use it in GitHub Desktop.
Open nvim files with television (text channel)
[metadata]
name = "text"
description = "A channel to find and select text from files"
requirements = ["rg", "bat"]
[source]
command = "rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always"
ansi = true
output = "{strip_ansi|split:\\::..2}"
# output = "+{strip_ansi|split:\\::1} {strip_ansi|split:\\::0}"
[preview]
command = "bat -n --color=always '{strip_ansi|split:\\::0}'"
env = { BAT_THEME = "ansi" }
offset = '{strip_ansi|split:\::1}'
[keybindings]
shortcut = "f4"
f12 = "actions:edit"
[actions.edit]
command = "nvim '+{strip_ansi|split:\\::1}' '{strip_ansi|split:\\::0}'"
mode = "execute"
[ui]
preview_panel = { header = '{strip_ansi|split:\::..2}' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment