-
Notifications
You must be signed in to change notification settings - Fork 45
Showcase
This section is meant as a community-driven list of user workflows and ways to use television in different contexts to inspire others.
https://marketplace.visualstudio.com/items?itemName=alexpasmantier.television
This is a drop-in file editor setup for the zed editor leveraging television, a task, and keybinding.
- Install television
- Add a task for a file finder (
zed: open tasks
command)
tasks.json
{
"label": "File Finder",
"command": "zeditor \"$(tv files)\"",
"hide": "always",
"allow_concurrent_runs": true,
"use_new_terminal": true
},
- Add keybinding to open file finder in center terminal (
zed: open keymap
command)
keymap.json
[
{
"bindings": {
// replace file_finder::Toggle
"cmd-p": [
"task::Spawn",
{ "task_name": "File Finder", "reveal_target": "center" }
]
}
}
]
This should result in an interaction similar to the GIF above.
credit: https://github.com/prabirshrestha/tv.vim
This is a drop-in project search setup for the zed editor with similar setup to the file finder.
Nagranie.z.ekranu.2025-01-27.o.17.18.37.mp4
- Install television
- Add a task for a file finder (zed: open tasks command)
tasks.json
{
"label": "Live Grep",
"command": "zed \"$(tv text)\"",
"hide": "always",
"allow_concurrent_runs": true,
"use_new_terminal": true,
},
- Add keybinding to open file finder in center terminal (zed: open keymap command)
keymap.json
{
"bindings": {
"space f w": [
"task::Spawn",
{ "task_name": "Live Grep", "reveal_target": "center" }
],
}
}
You can replace space f w
with your keybinding
Improve performance
If there's a delay before the Live Grep window lauches you can optimize this by spawning it in a different shell, eg. bash
or sh
.|
In the example below zed will use sh to spawn the process:
tasks.json
{
"label": "Live Grep",
"command": "zed \"$(tv text)\"",
"hide": "always",
"allow_concurrent_runs": true,
"use_new_terminal": true,
"shell": {
"program": "sh"
}
},
If you neeed further optimalization you can add commandline args like --noediting
, --norc
, --noprofile
to the shell process:
tasks.json
"shell": {
"with_arguments": {
"program": "sh",
"args": ["--noediting", "--norc", "--noprofile"]
}
}
or
tasks.json
"shell": {
"with_arguments": {
"program": "bash",
"args": ["--norc", "--noprofile"]
}
}
Note that you need to have
tv
in your$PATH
This optimizations can also be applied to file finder.
Huge thanks to eddiebergman and thomdabrowski for these optimizations, original thread