television/assets/js/a7b96eba.d25ba1b3.js
2025-07-19 22:38:08 +00:00

1 line
8.6 KiB
JavaScript

"use strict";(self.webpackChunktelevision_website=self.webpackChunktelevision_website||[]).push([[5540],{5404:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>a});var i=s(6672);const r={},t=i.createContext(r);function o(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(t.Provider,{value:n},e.children)}},7302:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"Users/showcase","title":"Showcase","description":"This section is meant as a community-driven list of user workflows and ways to use television in different contexts to inspire others.","source":"@site/../docs/01-Users/12-showcase.md","sourceDirName":"01-Users","slug":"/Users/showcase","permalink":"/television/docs/Users/showcase","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":12,"frontMatter":{},"sidebar":"docSidebar","previous":{"title":"Terminal Emulators","permalink":"/television/docs/Users/terminal_emulators"},"next":{"title":"Contributing new channels","permalink":"/television/docs/Users/contributing-channels"}}');var r=s(3420),t=s(5404);const o={},a="Showcase",d={},l=[{value:"\u2b50 VSCode extension",id:"-vscode-extension",level:3},{value:"\u2b50 Zed Editor File Finder",id:"-zed-editor-file-finder",level:3},{value:"\u2b50 Vim/Neovim plugin",id:"-vimneovim-plugin",level:3},{value:"\u2b50 Zed Editor Live Grep",id:"-zed-editor-live-grep",level:3}];function c(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"showcase",children:"Showcase"})}),"\n",(0,r.jsx)(n.p,{children:"This section is meant as a community-driven list of user workflows and ways to use television in different contexts to inspire others."}),"\n",(0,r.jsx)(n.h3,{id:"-vscode-extension",children:"\u2b50 VSCode extension"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=alexpasmantier.television",children:"https://marketplace.visualstudio.com/items?itemName=alexpasmantier.television"})}),"\n",(0,r.jsx)(n.h3,{id:"-zed-editor-file-finder",children:"\u2b50 Zed Editor File Finder"}),"\n",(0,r.jsxs)(n.p,{children:["This is a drop-in file editor setup for the ",(0,r.jsx)(n.a,{href:"https://zed.dev/",children:"zed editor"})," leveraging television, a task, and keybinding."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{src:"https://github.com/user-attachments/assets/fc50f835-a282-438a-bbad-507320017765",alt:"tv-zed-editor-compressed"})}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsx)(n.li,{children:"Install television"}),"\n",(0,r.jsxs)(n.li,{children:["Add a task for a file finder (",(0,r.jsx)(n.code,{children:"zed: open tasks"})," command)"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"tasks.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'{\n "label": "File Finder",\n "command": "zed $(tv files)",\n "hide": "always",\n "allow_concurrent_runs": true,\n "use_new_terminal": true\n},\n'})}),"\n",(0,r.jsxs)(n.ol,{start:"3",children:["\n",(0,r.jsxs)(n.li,{children:["Add keybinding to open file finder in center terminal (",(0,r.jsx)(n.code,{children:"zed: open keymap"})," command)"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"keymap.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsonc",children:'[\n {\n "bindings": {\n // replace file_finder::Toggle\n "cmd-p": [\n "task::Spawn",\n { "task_name": "File Finder", "reveal_target": "center" },\n ],\n },\n },\n]\n'})}),"\n",(0,r.jsx)(n.p,{children:"This should result in an interaction similar to the GIF above."}),"\n",(0,r.jsx)(n.h3,{id:"-vimneovim-plugin",children:"\u2b50 Vim/Neovim plugin"}),"\n",(0,r.jsxs)(n.p,{children:["credit: ",(0,r.jsx)(n.a,{href:"https://github.com/prabirshrestha/tv.vim",children:"https://github.com/prabirshrestha/tv.vim"})]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{src:"https://github.com/user-attachments/assets/c2a1dc2a-55d0-4b7b-9ac9-f04a5ac0cb33",alt:"tv.vim"})}),"\n",(0,r.jsx)(n.h3,{id:"-zed-editor-live-grep",children:"\u2b50 Zed Editor Live Grep"}),"\n",(0,r.jsxs)(n.p,{children:["This is a drop-in project search setup for the ",(0,r.jsx)(n.a,{href:"https://zed.dev/",children:"zed editor"})," with similar setup to the ",(0,r.jsx)(n.a,{href:"https://github.com/alexpasmantier/television/wiki/Showcase#--zed-editor-file-finder",children:"file finder"}),"."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/user-attachments/assets/5afb94af-f10a-4cac-9f51-0aa97b771bf0",children:"https://github.com/user-attachments/assets/5afb94af-f10a-4cac-9f51-0aa97b771bf0"})}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsx)(n.li,{children:"Install television"}),"\n",(0,r.jsx)(n.li,{children:"Add a task for a file finder (zed: open tasks command)"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"tasks.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "label": "Live Grep",\n "command": "zed $(tv text)",\n "hide": "always",\n "allow_concurrent_runs": true,\n "use_new_terminal": true,\n},\n'})}),"\n",(0,r.jsxs)(n.ol,{start:"3",children:["\n",(0,r.jsx)(n.li,{children:"Add keybinding to open file finder in center terminal (zed: open keymap command)"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"keymap.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "bindings": {\n "space f w": [\n "task::Spawn",\n { "task_name": "Live Grep", "reveal_target": "center" }\n ]\n }\n}\n'})}),"\n",(0,r.jsxs)(n.p,{children:["You can replace ",(0,r.jsx)(n.code,{children:"space f w"})," with your keybinding"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Improve performance"})}),"\n",(0,r.jsxs)(n.p,{children:["If there's a delay before the Live Grep window lauches you can optimize this by spawning it in a different shell, eg. ",(0,r.jsx)(n.code,{children:"bash"})," or ",(0,r.jsx)(n.code,{children:"sh"}),".|\nIn the example below zed will use sh to spawn the process:"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"tasks.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:' {\n "label": "Live Grep",\n "command": "zed $(tv text)",\n "hide": "always",\n "allow_concurrent_runs": true,\n "use_new_terminal": true,\n "shell": {\n "program": "sh"\n }\n },\n'})}),"\n",(0,r.jsxs)(n.p,{children:["If you neeed further optimalization you can add commandline args like ",(0,r.jsx)(n.code,{children:"--noediting"}),", ",(0,r.jsx)(n.code,{children:"--norc"}),", ",(0,r.jsx)(n.code,{children:"--noprofile"})," to the shell process:"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"tasks.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:' "shell": {\n "with_arguments": {\n "program": "sh",\n "args": ["--noediting", "--norc", "--noprofile"]\n }\n }\n'})}),"\n",(0,r.jsx)(n.p,{children:"or"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"tasks.json"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:' "shell": {\n "with_arguments": {\n "program": "bash",\n "args": ["--norc", "--noprofile"]\n }\n }\n'})}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["Note that you need to have ",(0,r.jsx)(n.code,{children:"tv"})," in your ",(0,r.jsx)(n.code,{children:"$PATH"})]}),"\n"]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["This optimizations can also be applied to ",(0,r.jsx)(n.a,{href:"https://github.com/alexpasmantier/television/wiki/Showcase#--zed-editor-file-finder",children:"file finder"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Huge thanks to ",(0,r.jsx)(n.a,{href:"https://github.com/eddiebergman",children:"eddiebergman"})," and ",(0,r.jsx)(n.a,{href:"https://github.com/thomdabrowski",children:"thomdabrowski"})," for these optimizations, ",(0,r.jsx)(n.a,{href:"https://github.com/zed-industries/zed/discussions/22581#discussioncomment-11860946",children:"original thread"})]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}}}]);