mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 11:32:42 +00:00
docs(docs): add television documentation and update shell docs for TV integration
This commit is contained in:
1 parent
3c4af515fa
commit
7c786f9349
11 files changed
+198
-57
No files matched your search
+1
-1
@@ -50,4 +50,4 @@ The default is `mac` on macOS and `desktop` everywhere else. See [Configuration]
|
|||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
The shared palette is **cyberdream**. bat, atuin, and yazi select it. fish and omp ship a cyberdream theme but do not select it. kitty takes its colors from the active Omarchy theme. The noctalia, koda, and ii-auto variants are shipped for ghostty, kitty, and yazi. The font is **Victor Mono Nerd Font**.
|
The shared palette is **cyberdream**. bat, atuin, and yazi select it, and television selects `cyberdream-transparent`, a variant without a background. fish and omp ship a cyberdream theme but do not select it. kitty takes its colors from the active Omarchy theme. The noctalia, koda, and ii-auto variants are shipped for ghostty, kitty, and yazi. The font is **Victor Mono Nerd Font**.
|
||||||
+37
-14
@@ -3,13 +3,14 @@ title: bash and zsh
|
|||||||
description: Secondary shells that share fish's aliases, starship prompt, atuin history, and cd-style helper functions.
|
description: Secondary shells that share fish's aliases, starship prompt, atuin history, and cd-style helper functions.
|
||||||
---
|
---
|
||||||
|
|
||||||
bash and zsh are set up so a shell other than fish feels the same: the same aliases, the same starship prompt, atuin history, and ports of the fish helpers that have to change the shell's own directory. zsh also gets ports of the fish key bindings.
|
bash and zsh are set up so a shell other than fish feels the same: the same aliases, the same starship prompt, atuin history, ports of the fish helpers that have to change the shell's own directory, and the same picker key bindings.
|
||||||
|
|
||||||
| Source (repo) | Target |
|
| Source (repo) | Target |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `dot_bashrc` | `~/.bashrc` |
|
| `dot_bashrc` | `~/.bashrc` |
|
||||||
| `dot_zshrc` | `~/.zshrc` |
|
| `dot_zshrc` | `~/.zshrc` |
|
||||||
| `dot_config/zsh/keybinds.zsh` | `~/.config/zsh/keybinds.zsh` |
|
| `dot_config/zsh/keybinds.zsh` | `~/.config/zsh/keybinds.zsh` |
|
||||||
|
| `dot_config/bash/keybinds.bash` | `~/.config/bash/keybinds.bash` |
|
||||||
| `dot_config/shell/aliases.sh.tmpl` | `~/.config/shell/aliases.sh` (template) |
|
| `dot_config/shell/aliases.sh.tmpl` | `~/.config/shell/aliases.sh` (template) |
|
||||||
| `dot_config/bash/functions/*.bash` | `~/.config/bash/functions/` |
|
| `dot_config/bash/functions/*.bash` | `~/.config/bash/functions/` |
|
||||||
| `dot_config/zsh/functions/*.zsh` | `~/.config/zsh/functions/` |
|
| `dot_config/zsh/functions/*.zsh` | `~/.config/zsh/functions/` |
|
||||||
@@ -24,7 +25,7 @@ bash is part of the base system. zsh itself is not listed in `.chezmoidata/packa
|
|||||||
|
|
||||||
Interactive shells only (`[[ $- != *i* ]] && return`). In order:
|
Interactive shells only (`[[ $- != *i* ]] && return`). In order:
|
||||||
|
|
||||||
1. **PATH.** Prepends `~/.local/bin` if missing, sources `~/.cargo/env` if present, and appends `~/.maestro/bin` if it exists.
|
1. **PATH.** Prepends `~/.local/bin` if missing, sources `~/.cargo/env` if present, and appends `~/.maestro/bin` if it exists. Exports `GHQ_ROOT` and `CODE_ROOT` as `~/Code`.
|
||||||
2. **Go.** `GOPATH=~/.local/share/go`, `GOBIN=$GOPATH/bin`, and `GOBIN` prepended to `PATH`. mise provides `GOROOT`.
|
2. **Go.** `GOPATH=~/.local/share/go`, `GOBIN=$GOPATH/bin`, and `GOBIN` prepended to `PATH`. mise provides `GOROOT`.
|
||||||
3. **Android SDK.** `ANDROID_HOME` and `ANDROID_SDK_ROOT` set to `~/.local/share/android`. `platform-tools`, `cmdline-tools/latest/bin`, and `emulator` are appended if they exist.
|
3. **Android SDK.** `ANDROID_HOME` and `ANDROID_SDK_ROOT` set to `~/.local/share/android`. `platform-tools`, `cmdline-tools/latest/bin`, and `emulator` are appended if they exist.
|
||||||
4. **Aliases.** Sources `~/.config/shell/aliases.sh`.
|
4. **Aliases.** Sources `~/.config/shell/aliases.sh`.
|
||||||
@@ -32,38 +33,40 @@ Interactive shells only (`[[ $- != *i* ]] && return`). In order:
|
|||||||
6. **Flyline.** If `~/.local/lib/libflyline.so` exists, loads it with `enable -f … flyline` for richer line editing.
|
6. **Flyline.** If `~/.local/lib/libflyline.so` exists, loads it with `enable -f … flyline` for richer line editing.
|
||||||
7. Sources `~/.config/envman/load.sh` if it is non-empty.
|
7. Sources `~/.config/envman/load.sh` if it is non-empty.
|
||||||
8. **Prompt.** `eval "$(starship init bash)"` if starship is installed.
|
8. **Prompt.** `eval "$(starship init bash)"` if starship is installed.
|
||||||
9. **atuin.** Sources `~/.atuin/bin/env`, then `eval "$(atuin init bash)"`.
|
9. **television.** `eval "$(tv init bash)"` if `tv` is installed (the `_tv` completion), then sources `~/.config/bash/keybinds.bash`.
|
||||||
|
10. **atuin.** Sources `~/.atuin/bin/env`, then `eval "$(atuin init bash)"`. atuin comes after tv, so it keeps <kbd>ctrl-r</kbd> and <kbd>up</kbd>.
|
||||||
bash has no custom key bindings. atuin's init binds <kbd>ctrl-r</kbd> and <kbd>up</kbd>.
|
|
||||||
|
|
||||||
## ~/.zshrc
|
## ~/.zshrc
|
||||||
|
|
||||||
1. **History.** `HISTFILE=~/.zsh_history`, `HISTSIZE=10000`, `SAVEHIST=10000`, `setopt SHARE_HISTORY HIST_IGNORE_DUPS`.
|
1. **History.** `HISTFILE=~/.zsh_history`, `HISTSIZE=10000`, `SAVEHIST=10000`, `setopt SHARE_HISTORY HIST_IGNORE_DUPS`.
|
||||||
2. **Completion.** `autoload -Uz compinit && compinit`.
|
2. **Completion.** `autoload -Uz compinit && compinit`.
|
||||||
3. The same PATH, Go, and Android blocks as `.bashrc`.
|
3. The same PATH, Go, and Android blocks as `.bashrc`, including `GHQ_ROOT` and `CODE_ROOT`.
|
||||||
4. Sources `~/.config/shell/aliases.sh`.
|
4. Sources `~/.config/shell/aliases.sh`.
|
||||||
5. Sources every `~/.config/zsh/functions/*.zsh`.
|
5. Sources every `~/.config/zsh/functions/*.zsh`.
|
||||||
6. Sources `~/.config/zsh/keybinds.zsh`.
|
6. Sources `~/.config/zsh/keybinds.zsh`.
|
||||||
7. `eval "$(suv init zsh)"` if suvadu is installed.
|
7. `eval "$(suv init zsh)"` if suvadu is installed.
|
||||||
8. Sources `~/.config/envman/load.sh` if it is non-empty.
|
8. Sources `~/.config/envman/load.sh` if it is non-empty.
|
||||||
9. `eval "$(starship init zsh)"` if starship is installed.
|
9. `eval "$(starship init zsh)"` if starship is installed.
|
||||||
10. **Syntax highlighting.** Sources the first `zsh-syntax-highlighting.zsh` found in `/usr/share/zsh/plugins/zsh-syntax-highlighting/`, `/opt/homebrew/share/zsh-syntax-highlighting/`, or `/usr/local/share/zsh-syntax-highlighting/`. The comment says this must stay last, because it wraps every zle widget defined before it.
|
10. `eval "$(tv init zsh)"` if `tv` is installed (<kbd>ctrl-t</kbd> smart autocomplete).
|
||||||
11. **atuin.** Sources `~/.atuin/bin/env` and runs `eval "$(atuin init zsh)"`. These lines come after the syntax-highlighting block, so despite the comment, syntax highlighting is not actually last.
|
11. **Syntax highlighting.** Sources the first `zsh-syntax-highlighting.zsh` found in `/usr/share/zsh/plugins/zsh-syntax-highlighting/`, `/opt/homebrew/share/zsh-syntax-highlighting/`, or `/usr/local/share/zsh-syntax-highlighting/`. The comment says this must stay last, because it wraps every zle widget defined before it.
|
||||||
|
12. **atuin.** Sources `~/.atuin/bin/env` and runs `eval "$(atuin init zsh)"`. These lines come after the syntax-highlighting block, so despite the comment, syntax highlighting is not actually last. atuin loads after tv, so it keeps <kbd>ctrl-r</kbd>.
|
||||||
|
|
||||||
## zsh key bindings
|
## zsh key bindings
|
||||||
|
|
||||||
`keybinds.zsh` ports `fish_user_key_bindings.fish` to zle. Unlike fish, zsh uses the **emacs** keymap: `bindkey -e` pins it so that `$EDITOR=nvim` does not switch zsh into vi mode. `unsetopt flow_control` frees <kbd>ctrl-q</kbd> and <kbd>ctrl-s</kbd> from the terminal.
|
`keybinds.zsh` ports `fish_user_key_bindings.fish` to zle. Unlike fish, zsh uses the **emacs** keymap: `bindkey -e` pins it so that `$EDITOR=nvim` does not switch zsh into vi mode. `unsetopt flow_control` frees <kbd>ctrl-q</kbd> and <kbd>ctrl-s</kbd> from the terminal.
|
||||||
|
|
||||||
A generic widget `_zle-run` is registered as `run-<cmd>` for `purple`, `clip-last`, `gho`, `pj`, `omp`, `yy`, and `lazygit`. It clears the pending display (`zle -I`), runs the command with the tty on stdin, then `zle reset-prompt`. Widgets run in the shell process, so directory changes made by `gho` and `yy` persist.
|
A generic widget `_zle-run` is registered as `run-<cmd>` for `purple`, `clip-last`, `gho`, `pj`, `omp`, `yy`, and `lazygit`. It clears the pending display (`zle -I`), runs the command with the tty on stdin, then `zle reset-prompt`. Widgets run in the shell process, so directory changes made by `gho` and `yy` persist. `tv-git-files` runs `tv git-files` the same way, and `pj-down` handles <kbd>down</kbd>.
|
||||||
|
|
||||||
| Key | Action |
|
| Key | Action |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| <kbd>ctrl-e</kbd> | `yy` (yazi, cd to its exit dir) |
|
| <kbd>ctrl-e</kbd> | `tv git-files` (pick a file, open it in nvim) |
|
||||||
| <kbd>ctrl-f</kbd> | `yy` |
|
| <kbd>ctrl-f</kbd> | `yy` |
|
||||||
| <kbd>ctrl-b</kbd> | `purple` (an external command; this repo does not provide it) |
|
| <kbd>ctrl-b</kbd> | `purple` (an external command; this repo does not provide it) |
|
||||||
| <kbd>ctrl-y</kbd> | `clip-last` |
|
| <kbd>ctrl-y</kbd> | `clip-last` |
|
||||||
| <kbd>ctrl-o</kbd> | `gho` (repo or vault picker, cd) |
|
| <kbd>ctrl-o</kbd> | `gho` (`ghq-repos` cable, cd) |
|
||||||
| <kbd>ctrl-p</kbd> | `pj` (task runner) |
|
| <kbd>ctrl-p</kbd> | `pj` (`pj` cable) |
|
||||||
|
| <kbd>ctrl-t</kbd> | tv smart autocomplete (from `tv init zsh`) |
|
||||||
|
| <kbd>down</kbd> | `pj-down`: `PJ_QUIET=1 pj` on an empty prompt, otherwise `down-line-or-history` (bound to `^[[B` and `^[OB`) |
|
||||||
| <kbd>ctrl-a</kbd> | `omp` |
|
| <kbd>ctrl-a</kbd> | `omp` |
|
||||||
| <kbd>ctrl-g</kbd> | `lazygit` |
|
| <kbd>ctrl-g</kbd> | `lazygit` |
|
||||||
| <kbd>ctrl-q</kbd> | `exit` |
|
| <kbd>ctrl-q</kbd> | `exit` |
|
||||||
@@ -71,7 +74,27 @@ A generic widget `_zle-run` is registered as `run-<cmd>` for `purple`, `clip-las
|
|||||||
|
|
||||||
<kbd>ctrl-c</kbd> is the tty interrupt character, so `bindkey '^C'` would never fire. The binding is a `TRAPINT` function instead. At the prompt it runs `zle .kill-buffer`, prints the clear sequence, and runs `zle .reset-prompt`. While a command is running, SIGINT keeps its normal behavior (returns `128+SIGINT`).
|
<kbd>ctrl-c</kbd> is the tty interrupt character, so `bindkey '^C'` would never fire. The binding is a `TRAPINT` function instead. At the prompt it runs `zle .kill-buffer`, prints the clear sequence, and runs `zle .reset-prompt`. While a command is running, SIGINT keeps its normal behavior (returns `128+SIGINT`).
|
||||||
|
|
||||||
The fish-only binds <kbd>ctrl-w</kbd> (atuin AI), <kbd>down</kbd> (`pj`), and <kbd>?</kbd> have no zsh equivalent. <kbd>ctrl-h/j/k/l</kbd> belong to kitty ([kitty](/terminal/kitty)) and are not bound here.
|
The fish-only binds <kbd>ctrl-w</kbd> (atuin AI) and <kbd>?</kbd> have no zsh equivalent. <kbd>ctrl-h/j/k/l</kbd> belong to kitty ([kitty](/terminal/kitty)) and are not bound here. The cables are described on the [television](/tools/television) page.
|
||||||
|
|
||||||
|
## bash key bindings
|
||||||
|
|
||||||
|
`keybinds.bash` gives bash the same picker keys as fish and zsh. bash keeps readline's default emacs keymap.
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
| --- | --- |
|
||||||
|
| <kbd>ctrl-o</kbd> | `gho` (`ghq-repos` cable, cd) |
|
||||||
|
| <kbd>ctrl-e</kbd> | `tv git-files` |
|
||||||
|
| <kbd>ctrl-p</kbd> | `pj` (`pj` cable) |
|
||||||
|
| <kbd>down</kbd> | `pj` cable on an empty prompt (`PJ_QUIET=1`), otherwise `history-search-forward` |
|
||||||
|
| <kbd>ctrl-t</kbd> | `_kb_tv_autocomplete`: runs `tv --autocomplete-prompt` on the text left of the cursor and inserts the picks there, each `printf %q`-quoted |
|
||||||
|
|
||||||
|
Each picker key is a readline macro `\C-xN \C-m \C-x0` built by `_kb_bind KEY SLOT COMMAND…`:
|
||||||
|
|
||||||
|
1. `\C-xN` is a `bind -x` for `_kb_run`, which stashes `READLINE_LINE` and runs the command in the shell process, so the `cd` done by `gho` persists.
|
||||||
|
2. `\C-m` accepts the now-empty line, so bash prints a fresh prompt for the new cwd. Nothing reaches history.
|
||||||
|
3. `\C-x0` runs `_kb_restore`, which puts the typed text back.
|
||||||
|
|
||||||
|
<kbd>down</kbd> (`\e[B` and `\eOB`) is the macro `\C-x4\C-x5`. `bind -x` cannot call readline functions, so `_kb_down` (`\C-x4`) rebinds `\C-x5` to `history-search-forward` when the line is non-empty, or runs `pj` and rebinds `\C-x5` to `redraw-current-line`. The slots used are `\C-x0` through `\C-x5`.
|
||||||
|
|
||||||
## Shared aliases: aliases.sh
|
## Shared aliases: aliases.sh
|
||||||
|
|
||||||
@@ -118,7 +141,7 @@ Each directory holds one function per file. bash and zsh source every file at st
|
|||||||
| `clip-last` | Re-runs the previous history entry (`fc -ln -1 -1`, skipping itself if the line editor already recorded `clip-last`), pipes the output to `wl-copy` or `pbcopy`, and sends a `notify-send -a shell` notification if available |
|
| `clip-last` | Re-runs the previous history entry (`fc -ln -1 -1`, skipping itself if the line editor already recorded `clip-last`), pipes the output to `wl-copy` or `pbcopy`, and sends a `notify-send -a shell` notification if available |
|
||||||
| `ghg <repo>` | `ghg-clone "$@"`, cd into the printed path, `clear && onefetch` |
|
| `ghg <repo>` | `ghg-clone "$@"`, cd into the printed path, `clear && onefetch` |
|
||||||
| `ghn <name>` | `command ghn "$@"`, cd into the printed path |
|
| `ghn <name>` | `command ghn "$@"`, cd into the printed path |
|
||||||
| `gho` | `command gho`, cd into the printed path, `clear`, and `onefetch` if it is a git repo |
|
| `gho` | `dir=$(tv ghq-repos)`, return if empty, cd into it, `clear`, and `onefetch` if it is a git repo |
|
||||||
| `yy [args]` | `yazi --cwd-file=<tmp>`, then cd to the directory written there if it changed |
|
| `yy [args]` | `yazi --cwd-file=<tmp>`, then cd to the directory written there if it changed |
|
||||||
|
|
||||||
The `ghg` helper script is named `ghg-clone` because an unrelated cargo binary already uses the name `ghg`. The [Scripts](/shell/scripts#why-some-helpers-are-shell-functions) page explains why these helpers are shell functions and not scripts.
|
The `ghg` helper script is named `ghg-clone` because an unrelated cargo binary already uses the name `ghg`. The [Scripts](/shell/scripts#why-some-helpers-are-shell-functions) page explains why these helpers are shell functions and not scripts.
|
||||||
+9
-7
@@ -179,16 +179,16 @@ The header comment says the file should stay empty, but it holds the following:
|
|||||||
|
|
||||||
| Key | Action |
|
| Key | Action |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| <kbd>ctrl-e</kbd> | `yy`: yazi, then cd to the directory yazi exited in |
|
| <kbd>ctrl-e</kbd> | `tv git-files`, then repaint: pick a file in the repo and open it in nvim ([television](/tools/television#git-files)) |
|
||||||
| <kbd>ctrl-f</kbd> | `yy` (same as <kbd>ctrl-e</kbd>) |
|
| <kbd>ctrl-f</kbd> | `yy`: yazi, then cd to the directory yazi exited in |
|
||||||
| <kbd>ctrl-b</kbd> | `purple`, then repaint (an external command; this repo does not provide it) |
|
| <kbd>ctrl-b</kbd> | `purple`, then repaint (an external command; this repo does not provide it) |
|
||||||
| <kbd>ctrl-y</kbd> | `clip-last`: re-run the last command and copy its output |
|
| <kbd>ctrl-y</kbd> | `clip-last`: re-run the last command and copy its output |
|
||||||
| <kbd>ctrl-o</kbd> | `gho`: pick a ghq repo or Obsidian vault and cd into it |
|
| <kbd>ctrl-o</kbd> | `gho`: pick a ghq repo or Obsidian vault from the `ghq-repos` cable and cd into it |
|
||||||
| <kbd>ctrl-p</kbd> | `pj`: fzf task runner ([Scripts](/shell/scripts#pj)) |
|
| <kbd>ctrl-p</kbd> | `pj`: task runner on the `pj` cable ([Scripts](/shell/scripts#pj)) |
|
||||||
| <kbd>ctrl-a</kbd> | `omp` (the coding agent, see [AI agents](/ai)) |
|
| <kbd>ctrl-a</kbd> | `omp` (the coding agent, see [AI agents](/ai)) |
|
||||||
| <kbd>ctrl-w</kbd> | `atuin ai inline`: natural-language command overlay |
|
| <kbd>ctrl-w</kbd> | `atuin ai inline`: natural-language command overlay |
|
||||||
| <kbd>ctrl-g</kbd> | `lazygit` |
|
| <kbd>ctrl-g</kbd> | `lazygit` |
|
||||||
| <kbd>down</kbd> | `_pj_bind_down`: runs `pj` on an idle, empty prompt, otherwise fish's `down-or-search` |
|
| <kbd>down</kbd> | `_pj_bind_down`: opens the `pj` cable on an idle, empty prompt, otherwise fish's `down-or-search` |
|
||||||
| <kbd>ctrl-c</kbd> | Clears the command line, runs `clear` (screen and kitty scrollback), repaints |
|
| <kbd>ctrl-c</kbd> | Clears the command line, runs `clear` (screen and kitty scrollback), repaints |
|
||||||
| <kbd>ctrl-q</kbd> | `exit` |
|
| <kbd>ctrl-q</kbd> | `exit` |
|
||||||
|
|
||||||
@@ -203,6 +203,8 @@ Bindings added by tool init scripts:
|
|||||||
|
|
||||||
`_pj_bind_down` hands the key to `down-or-search` when the buffer is non-empty, the completion pager is open, or history search is active. Otherwise it runs `PJ_QUIET=1 pj`, so pressing down outside a project does nothing and prints no error.
|
`_pj_bind_down` hands the key to `down-or-search` when the buffer is non-empty, the completion pager is open, or history search is active. Otherwise it runs `PJ_QUIET=1 pj`, so pressing down outside a project does nothing and prints no error.
|
||||||
|
|
||||||
|
zsh and bash bind <kbd>ctrl-o</kbd>, <kbd>ctrl-e</kbd>, <kbd>ctrl-p</kbd>, <kbd>down</kbd>, and <kbd>ctrl-t</kbd> the same way ([bash and zsh](/shell/bash-zsh)). Inside television, <kbd>ctrl-e</kbd> runs the channel's `edit` action and <kbd>ctrl-h</kbd> its `goto_parent_dir` action (`television/config.toml`). The config and cables are on the [television](/tools/television) page.
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
Under kitty, <kbd>ctrl-g</kbd> (lazygit overlay), <kbd>ctrl-a</kbd> (omp split), <kbd>ctrl-y</kbd> (yazi split), and <kbd>ctrl-h/j/k/l</kbd> (split navigation) are mapped in `kitty.conf` and never reach fish. The fish binds for those keys only apply in other terminals. See [kitty](/terminal/kitty).
|
Under kitty, <kbd>ctrl-g</kbd> (lazygit overlay), <kbd>ctrl-a</kbd> (omp split), <kbd>ctrl-y</kbd> (yazi split), and <kbd>ctrl-h/j/k/l</kbd> (split navigation) are mapped in `kitty.conf` and never reach fish. The fish binds for those keys only apply in other terminals. See [kitty](/terminal/kitty).
|
||||||
:::
|
:::
|
||||||
@@ -253,7 +255,7 @@ Every file in `functions/` is autoloaded by name. Several also exist as POSIX sc
|
|||||||
| `_nvm_list` | nvm.fish internal: lists installed Node versions plus `system` |
|
| `_nvm_list` | nvm.fish internal: lists installed Node versions plus `system` |
|
||||||
| `_nvm_version_activate` | nvm.fish internal: sets `nvm_current_version` and prepends its `bin` to `PATH` |
|
| `_nvm_version_activate` | nvm.fish internal: sets `nvm_current_version` and prepends its `bin` to `PATH` |
|
||||||
| `_nvm_version_deactivate` | nvm.fish internal: removes a version's `bin` from `PATH` |
|
| `_nvm_version_deactivate` | nvm.fish internal: removes a version's `bin` from `PATH` |
|
||||||
| `_pj_bind_down` | Down-arrow handler: `pj` on an empty idle prompt, else `down-or-search` |
|
| `_pj_bind_down` | Down-arrow handler: `pj` (tv cable) on an empty idle prompt, else `down-or-search` |
|
||||||
| `ai` | `gum choose` among `claude`, `opencode`, `codex`, `hermes`, `fractal`. `claude` runs with `--dangerously-skip-permissions` |
|
| `ai` | `gum choose` among `claude`, `opencode`, `codex`, `hermes`, `fractal`. `claude` runs with `--dangerously-skip-permissions` |
|
||||||
| `c` | `clear` with no argument, `cd <dir>` with one |
|
| `c` | `clear` with no argument, `cd <dir>` with one |
|
||||||
| `c2p` | fzf-pick a `.hbs` template under `~/.config/code2prompt` and run `code2prompt --template` |
|
| `c2p` | fzf-pick a `.hbs` template under `~/.config/code2prompt` and run `code2prompt --template` |
|
||||||
@@ -270,7 +272,7 @@ Every file in `functions/` is autoloaded by name. Several also exist as POSIX sc
|
|||||||
| `gh-sonr-org-migrate` | Script body (see the warning below) that moves every repo from `*sonr*` GitHub orgs into `sonr-io` and deletes the emptied orgs |
|
| `gh-sonr-org-migrate` | Script body (see the warning below) that moves every repo from `*sonr*` GitHub orgs into `sonr-io` and deletes the emptied orgs |
|
||||||
| `ghg <repo>` | `ghg-clone <repo>` (ghq get), cd into the clone, `clear`, `onefetch` |
|
| `ghg <repo>` | `ghg-clone <repo>` (ghq get), cd into the clone, `clear`, `onefetch` |
|
||||||
| `ghn <name>` | Runs `~/.local/bin/ghn` to create and clone a private repo, then cds into it |
|
| `ghn <name>` | Runs `~/.local/bin/ghn` to create and clone a private repo, then cds into it |
|
||||||
| `gho` | Runs `~/.local/bin/gho` (repo/vault picker), cds into the result, `clear`, and `onefetch` inside git repos |
|
| `gho` | `tv ghq-repos` (repo/vault picker); returns if nothing was picked, else cds into the result, `clear`, and `onefetch` inside git repos |
|
||||||
| `git-summary [flags]` | `code2prompt` over the repo root, including only `AGENTS.md` files, using `~/.config/code2prompt/agents-md.hbs`. Extra flags pass through |
|
| `git-summary [flags]` | `code2prompt` over the repo root, including only `AGENTS.md` files, using `~/.config/code2prompt/agents-md.hbs`. Extra flags pass through |
|
||||||
| `gtm [repo]` | Migrates GitHub repos to a prad.codes (Gitea) org with `tea repos migrate`. With no argument, fzf multi-selects from `gh repo list`. You pick the target org and migration options (wiki, issues, labels, pull-requests, releases, milestones, lfs, mirror) with gum, private repos stay private, and it offers to clone the results with `ghg-clone`. Fish only |
|
| `gtm [repo]` | Migrates GitHub repos to a prad.codes (Gitea) org with `tea repos migrate`. With no argument, fzf multi-selects from `gh repo list`. You pick the target org and migration options (wiki, issues, labels, pull-requests, releases, milestones, lfs, mirror) with gum, private repos stay private, and it offers to clone the results with `ghg-clone`. Fish only |
|
||||||
| `launch_omp_livediff_overlay` | Uses `kitty @` to overlay `omp` on the current window with a `livediff` vsplit beside it. Needs `KITTY_LISTEN_ON` |
|
| `launch_omp_livediff_overlay` | Uses `kitty @` to overlay `omp` on the current window with a `livediff` vsplit beside it. Needs `KITTY_LISTEN_ON` |
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ fish is the main interactive shell. bash and zsh are set up to feel the same: th
|
|||||||
| Page | Covers |
|
| Page | Covers |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [fish](/shell/fish) | `~/.config/fish`: `config.fish`, every `conf.d/` file (PATH, env, aliases, ssh-agent, tool init, secrets by name), vi-mode key bindings, the cyberdream theme, completions, the nvm.fish plugin, and every function in `functions/` |
|
| [fish](/shell/fish) | `~/.config/fish`: `config.fish`, every `conf.d/` file (PATH, env, aliases, ssh-agent, tool init, secrets by name), vi-mode key bindings, the cyberdream theme, completions, the nvm.fish plugin, and every function in `functions/` |
|
||||||
| [bash and zsh](/shell/bash-zsh) | `~/.bashrc`, `~/.zshrc`, zsh key bindings, `~/.config/shell/aliases.sh`, per-shell function ports |
|
| [bash and zsh](/shell/bash-zsh) | `~/.bashrc`, `~/.zshrc`, zsh and bash key bindings, `~/.config/shell/aliases.sh`, per-shell function ports |
|
||||||
| [Aliases](/shell/aliases) | Every alias from `.chezmoidata/aliases.yaml` plus the fish-only and shell-specific ones |
|
| [Aliases](/shell/aliases) | Every alias from `.chezmoidata/aliases.yaml` plus the fish-only and shell-specific ones |
|
||||||
| [Scripts](/shell/scripts) | Every general-purpose executable in `~/.local/bin` (`pj`, `gho`, `ghn`, `gop`, `atuin-pick`, …) |
|
| [Scripts](/shell/scripts) | Every general-purpose executable in `~/.local/bin` (`pj`, `ghn`, `gop`, `mtime-sort`, `atuin-pick`, …) |
|
||||||
| [Starship](/shell/starship) | `~/.config/starship.toml`: format, modules, symbols, cyberdream palette |
|
| [Starship](/shell/starship) | `~/.config/starship.toml`: format, modules, symbols, cyberdream palette |
|
||||||
| [atuin](/shell/atuin) | `~/.config/atuin`: history search settings, AI inline integration, cyberdream theme |
|
| [atuin](/shell/atuin) | `~/.config/atuin`: history search settings, AI inline integration, cyberdream theme |
|
||||||
|
|
||||||
|
|||||||
+31
-28
@@ -19,10 +19,10 @@ A script runs as a child process, and a child cannot change its parent shell's w
|
|||||||
| `yy` (and fish's `y`) | cds into the directory yazi exited in |
|
| `yy` (and fish's `y`) | cds into the directory yazi exited in |
|
||||||
| `c` | cds when given an argument |
|
| `c` | cds when given an argument |
|
||||||
| `cd` | Replaces the `cd` builtin with a zoxide fallback |
|
| `cd` | Replaces the `cd` builtin with a zoxide fallback |
|
||||||
| `ghg`, `ghn`, `gho` | cd into a repo that the script picked or cloned |
|
| `ghg`, `ghn`, `gho` | cd into a repo that was picked or cloned |
|
||||||
| `clip-last` | Reads the shell's own history (`$history[1]` in fish, `fc` in bash/zsh) |
|
| `clip-last` | Reads the shell's own history (`$history[1]` in fish, `fc` in bash/zsh) |
|
||||||
|
|
||||||
For `ghg`, `ghn`, and `gho`, the work lives in a script that prints a directory on stdout (and everything else on stderr). The shell function captures that path and cds into it. `ghg`'s script is named `ghg-clone` because an unrelated cargo binary already uses the name `ghg`.
|
For `ghg` and `ghn`, the work lives in a script that prints a directory on stdout (and everything else on stderr). The shell function captures that path and cds into it. `ghg`'s script is named `ghg-clone` because an unrelated cargo binary already uses the name `ghg`. `gho` has no script: the function reads the path from `tv ghq-repos` ([television](/tools/television#ghq-repos)).
|
||||||
|
|
||||||
Several scripts below also exist as fish functions of the same name (`ai`, `c2p`, `extract_agents`, `fab`, `gdc`, `git-summary`, `lc-elir`, `mdcp`, `mdp`, `launch_omp_livediff_overlay`, `gh-sonr-org-migrate`). In fish the function runs instead of the script. Both versions behave the same. See [fish functions](/shell/fish#functions).
|
Several scripts below also exist as fish functions of the same name (`ai`, `c2p`, `extract_agents`, `fab`, `gdc`, `git-summary`, `lc-elir`, `mdcp`, `mdp`, `launch_omp_livediff_overlay`, `gh-sonr-org-migrate`). In fish the function runs instead of the script. Both versions behave the same. See [fish functions](/shell/fish#functions).
|
||||||
|
|
||||||
@@ -39,14 +39,14 @@ Several scripts below also exist as fish functions of the same name (`ai`, `c2p`
|
|||||||
| [`gh-sonr-org-migrate`](#gh-sonr-org-migrate) | bash | Consolidate `*sonr*` GitHub orgs into `sonr-io` |
|
| [`gh-sonr-org-migrate`](#gh-sonr-org-migrate) | bash | Consolidate `*sonr*` GitHub orgs into `sonr-io` |
|
||||||
| [`ghg-clone`](#ghg-clone) | sh | `ghq get` and print the clone path |
|
| [`ghg-clone`](#ghg-clone) | sh | `ghq get` and print the clone path |
|
||||||
| [`ghn`](#ghn) | sh | Create a private repo, clone it, print the path |
|
| [`ghn`](#ghn) | sh | Create a private repo, clone it, print the path |
|
||||||
| [`gho`](#gho) | sh | Pick a ghq repo or Obsidian vault, print the path |
|
|
||||||
| [`git-summary`](#git-summary) | sh | Aggregate a repo's `AGENTS.md` files with code2prompt |
|
| [`git-summary`](#git-summary) | sh | Aggregate a repo's `AGENTS.md` files with code2prompt |
|
||||||
| [`gop`](#gop) | sh | Open the current repo's web page |
|
| [`gop`](#gop) | sh | Open the current repo's web page |
|
||||||
| [`launch_omp_livediff_overlay`](#launch_omp_livediff_overlay) | sh | omp overlay plus a livediff split in kitty |
|
| [`launch_omp_livediff_overlay`](#launch_omp_livediff_overlay) | sh | omp overlay plus a livediff split in kitty |
|
||||||
| [`lc-elir`](#lc-elir) | sh | Run `/leetcode-eli5` via omp on picked solutions |
|
| [`lc-elir`](#lc-elir) | sh | Run `/leetcode-eli5` via omp on picked solutions |
|
||||||
| [`mdcp`](#mdcp) | sh | Fetch a URL as Markdown, copy it, preview it |
|
| [`mdcp`](#mdcp) | sh | Fetch a URL as Markdown, copy it, preview it |
|
||||||
| [`mdp`](#mdp) | sh | fzf Markdown picker with mdfried preview |
|
| [`mdp`](#mdp) | sh | fzf Markdown picker with mdfried preview |
|
||||||
| [`pj`](#pj) | bash | fzf task runner across every project task source |
|
| [`mtime-sort`](#mtime-sort) | sh + perl | Sort path lines newest-first by mtime |
|
||||||
|
| [`pj`](#pj) | bash | Task runner across every project task source, on a tv cable |
|
||||||
| [`yazi-nvim-open`](#yazi-nvim-open) | sh | yazi opener that targets the host Neovim |
|
| [`yazi-nvim-open`](#yazi-nvim-open) | sh | yazi opener that targets the host Neovim |
|
||||||
|
|
||||||
## ai
|
## ai
|
||||||
@@ -148,7 +148,7 @@ Accepts `https://…`, `ssh://…`, `git@host:user/repo`, `host/user/repo`, or `
|
|||||||
|
|
||||||
**Used by:** the `ghg` shell function, which cds into the path, clears the screen, and runs `onefetch`. The fish function `gtm` also uses it to clone migrated repos.
|
**Used by:** the `ghg` shell function, which cds into the path, clears the screen, and runs `onefetch`. The fish function `gtm` also uses it to clone migrated repos.
|
||||||
|
|
||||||
**Needs:** `ghq` (`GHQ_ROOT=~/Code` in fish), optional `zoxide`.
|
**Needs:** `ghq` (`GHQ_ROOT=~/Code`, exported by fish, zsh, and bash), optional `zoxide`.
|
||||||
|
|
||||||
## ghn
|
## ghn
|
||||||
|
|
||||||
@@ -165,23 +165,6 @@ You pick the host with `gum choose`. The script prints the clone directory, and
|
|||||||
|
|
||||||
**Needs:** `gum`, `ghq`, and `tea` or `gh`.
|
**Needs:** `gum`, `ghq`, and `tea` or `gh`.
|
||||||
|
|
||||||
## gho
|
|
||||||
|
|
||||||
```sh
|
|
||||||
gho
|
|
||||||
```
|
|
||||||
|
|
||||||
An fzf picker with two lists. <kbd>tab</kbd> switches between them:
|
|
||||||
|
|
||||||
- `repo:`: `ghq list` plus the chezmoi source tree, listed as `github.com/prdlk/dotfiles` and mapped back to `~/.local/share/chezmoi`. `--tiebreak=end` favors matches at the end of the name.
|
|
||||||
- `vault:`: the Obsidian vaults `~/Documents/Obsidian/Personal`, `Walletbase`, and `Research`.
|
|
||||||
|
|
||||||
It prints the chosen directory. fzf's bind snippets run under `SHELL=/bin/sh`, so they behave the same whatever the login shell. The `gho` shell function cds into the result, clears the screen, and runs `onefetch` in git repos.
|
|
||||||
|
|
||||||
**Launched by:** <kbd>ctrl-o</kbd> in fish and zsh.
|
|
||||||
|
|
||||||
**Needs:** `ghq`, `fzf`, `onefetch` (for the wrapper).
|
|
||||||
|
|
||||||
## git-summary
|
## git-summary
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -245,13 +228,25 @@ Lists `*.md` files up to 3 directories deep with `fd`. fzf shows an `mdfried` pr
|
|||||||
|
|
||||||
**Needs:** `fd`, `fzf`, `mdfried`.
|
**Needs:** `fd`, `fzf`, `mdfried`.
|
||||||
|
|
||||||
|
## mtime-sort
|
||||||
|
|
||||||
|
```sh
|
||||||
|
… | mtime-sort [--repo]
|
||||||
|
```
|
||||||
|
|
||||||
|
Reads lines on stdin and prints them newest-first by the mtime of each line's last tab-separated field (the whole line when it has no tab). With `--repo`, it stats `<path>/.git/index` first, so a repo sorts by its last git activity. Lines whose path does not exist are dropped. Ties keep input order.
|
||||||
|
|
||||||
|
**Used by:** every custom [television](/tools/television) cable and `pj --list`. tv layers match quality and frecency on top of this order.
|
||||||
|
|
||||||
|
**Needs:** `perl`.
|
||||||
|
|
||||||
## pj
|
## pj
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pj [extra args…]
|
pj [extra args…]
|
||||||
```
|
```
|
||||||
|
|
||||||
A task runner that searches every task source in the project and lets you pick one with fzf.
|
A task runner that searches every task source in the project and lets you pick one in the `pj` [television](/tools/television#pj) cable.
|
||||||
|
|
||||||
**Sources.** Each is listed only when its runner is installed:
|
**Sources.** Each is listed only when its runner is installed:
|
||||||
|
|
||||||
@@ -271,15 +266,23 @@ A task runner that searches every task source in the project and lets you pick o
|
|||||||
|
|
||||||
**Scanning.** Walks from `$PWD` up to the git toplevel, inclusive. Outside a repo it stops at the first directory that produced tasks.
|
**Scanning.** Walks from `$PWD` up to the git toplevel, inclusive. Outside a repo it stops at the first directory that produced tasks.
|
||||||
|
|
||||||
**Picker.** Rows are tagged with the tool (`npm`, `pnpm`, `bun`, `make`, `just`, `mise`, `poe`, `py`, …), so typing a tool name filters to it. A directory column appears when more than one project contributed tasks. The header shows the nearest project root. The preview (top, 6 lines) shows the task body: the npm script string, the Make recipe, `just --show`, `mise tasks info`, the devbox script, or the pyproject entry.
|
**Picker.** `pj` writes the records to a temp file and runs `tv pj --source-command "cat <tmp>" --input-header <project root>`. Rows are tagged with the tool (`npm`, `pnpm`, `bun`, `make`, `just`, `mise`, `poe`, `py`, …), so typing a tool name filters to it. A directory column appears when more than one project contributed tasks. Tasks are sorted by their manifest's mtime, newest first, through `mtime-sort`. The preview shows the task body: the npm script string, the Make recipe, `just --show`, `mise tasks info`, the devbox script, or the pyproject entry.
|
||||||
|
|
||||||
**Run.** cds into the task's directory and `exec`s the runner. Extra arguments are forwarded, with `--` inserted for `npm run`, `mise`, and `devbox`. Tasks named `dev`, `start`, `serve`, `watch`, or namespaced variants like `dev:web` are wrapped in `openlogs` (found on `PATH`, via `mise which`, or in mise's node installs) for a live log tail. Without openlogs they run unwrapped, with a note.
|
**Entry points.** The cable calls back into the script:
|
||||||
|
|
||||||
**Env.** `PJ_QUIET=1` suppresses the "no task sources found" error. The fish <kbd>down</kbd> binding uses it.
|
| Command | Does |
|
||||||
|
| --- | --- |
|
||||||
|
| `pj --list` | Prints tab-separated records: display, kind, target, root, runner, manifest |
|
||||||
|
| `pj --preview KIND TARGET ROOT FILE` | Prints the task body for the preview pane |
|
||||||
|
| `pj --run KIND TARGET ROOT RUNNER` | Runs the task (enter) |
|
||||||
|
|
||||||
**Launched by:** <kbd>ctrl-p</kbd> in fish and zsh, and <kbd>down</kbd> on an empty fish prompt.
|
**Run.** cds into the task's directory and `exec`s the runner. Extra arguments given to `pj` travel to the task through `$PJ_EXTRA` (shell-quoted), with `--` inserted for `npm run`, `mise`, and `devbox`. Tasks named `dev`, `start`, `serve`, `watch`, or namespaced variants like `dev:web` are wrapped in `openlogs` (found on `PATH`, via `mise which`, or in mise's node installs) for a live log tail. Without openlogs they run unwrapped, with a note.
|
||||||
|
|
||||||
**Needs:** `bash`, `fzf`, `jq`, `python3` 3.11+ (for `tomllib`), plus whichever runners the project uses.
|
**Env.** `PJ_QUIET=1` suppresses the "no task sources found" error (exit status stays 1). The <kbd>down</kbd> bindings use it.
|
||||||
|
|
||||||
|
**Launched by:** <kbd>ctrl-p</kbd>, and <kbd>down</kbd> on an empty prompt, in fish, zsh, and bash.
|
||||||
|
|
||||||
|
**Needs:** `bash`, `tv`, `mtime-sort`, `jq`, `python3` 3.11+ (for `tomllib`), plus whichever runners the project uses.
|
||||||
|
|
||||||
## yazi-nvim-open
|
## yazi-nvim-open
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ Kitten `ssh` config: for `hostname goliath`, `share_connections yes`.
|
|||||||
| File | Purpose |
|
| File | Purpose |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `tab_bar.py` | Provides `draw_title` for `{custom}` in the tab template. Title is `<index> <icon> <label>`: the label is the git repo root name of the tab's cwd (walks up for `.git`), or the file nvim is editing (parsed from nvim's title). Icon comes from the foreground process cmdline (editors, AI agents like claude/omp/opencode/codex, git tools, docker, herdr, tmux, yazi, btop, atuin, ssh, chezmoi, …) with a folder fallback. Labels are elided at 28 chars. No subprocesses or timers. |
|
| `tab_bar.py` | Provides `draw_title` for `{custom}` in the tab template. Title is `<index> <icon> <label>`: the label is the git repo root name of the tab's cwd (walks up for `.git`), or the file nvim is editing (parsed from nvim's title). Icon comes from the foreground process cmdline (editors, AI agents like claude/omp/opencode/codex, git tools, docker, herdr, tmux, yazi, btop, atuin, ssh, chezmoi, …) with a folder fallback. Labels are elided at 28 chars. No subprocesses or timers. |
|
||||||
| `pass_keys.py` | Bound to `ctrl+h/j/k/l`. If the window's foreground process matches `vim`, `nvim`, `fzf`, `tmux` or `herdr`, the key is forwarded; otherwise kitty moves to the neighboring window. |
|
| `pass_keys.py` | Bound to `ctrl+h/j/k/l`. If the window's foreground process matches `vim`, `nvim`, `fzf`, `tv`, `tmux` or `herdr`, the key is forwarded; otherwise kitty moves to the neighboring window. |
|
||||||
| `navigate_kitty.py` | No-UI kitten that calls `neighboring_window` with a direction argument; the counterpart nvim can invoke. Not mapped in `kitty.conf`. |
|
| `navigate_kitty.py` | No-UI kitten that calls `neighboring_window` with a direction argument; the counterpart nvim can invoke. Not mapped in `kitty.conf`. |
|
||||||
| `select_tab.py` | Full-screen fuzzy tab picker using `kitty @ ls` data; shows cwds zsh-style. Keys: Up/Down/PgUp/PgDn scroll, Enter selects, typing filters, `ctrl+c`/Esc quits. Not mapped in `kitty.conf`. |
|
| `select_tab.py` | Full-screen fuzzy tab picker using `kitty @ ls` data; shows cwds zsh-style. Keys: Up/Down/PgUp/PgDn scroll, Enter selects, typing filters, `ctrl+c`/Esc quits. Not mapped in `kitty.conf`. |
|
||||||
| `switchtab.py` | Focuses the tab whose `vt` user var matches the argument, or launches one with that var and reorders tabs by `vt`. Not mapped. |
|
| `switchtab.py` | Focuses the tab whose `vt` user var matches the argument, or launches one with that var and reorders tabs by `vt`. Not mapped. |
|
||||||
|
|||||||
+2
-2
@@ -105,8 +105,8 @@ These git-adjacent commands live in `~/.local/bin` and the shell function direct
|
|||||||
| Command | What it does |
|
| Command | What it does |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `gdc` | Asks for confirmation with `gum confirm`, then runs `git reset --hard HEAD` and `git clean -fd`. |
|
| `gdc` | Asks for confirmation with `gum confirm`, then runs `git reset --hard HEAD` and `git clean -fd`. |
|
||||||
| `gop` | Opens a repo's web page for any forge whose layout is `https://<host>/<owner>/<repo>`; defaults to `origin`, then `upstream`. |
|
| `gop` | Opens a repo's web page for any forge whose layout is `https://<host>/<owner>/<repo>`; defaults to `origin`, then `upstream`. Also the <kbd>ctrl-b</kbd> action of the `ghq-repos` [television](/tools/television#ghq-repos) cable. |
|
||||||
| `git-summary` | Aggregates every `AGENTS.md` in the current repo through `code2prompt`. |
|
| `git-summary` | Aggregates every `AGENTS.md` in the current repo through `code2prompt`. |
|
||||||
| `ghg` / `ghg-clone` | `ghq get` a repo and `cd` into the clone. |
|
| `ghg` / `ghg-clone` | `ghq get` a repo and `cd` into the clone. |
|
||||||
| `ghn` | Creates a private repo on prad.codes (via `tea`) or github.com (via `gh`), clones it with ghq, and `cd`s into it. |
|
| `ghn` | Creates a private repo on prad.codes (via `tea`) or github.com (via `gh`), clones it with ghq, and `cd`s into it. |
|
||||||
| `gho` | Picks a ghq repo or Obsidian vault with fzf and `cd`s into it. |
|
| `gho` | Picks a ghq repo or Obsidian vault with the `ghq-repos` [television](/tools/television#ghq-repos) cable and `cd`s into it. |
|
||||||
@@ -22,6 +22,7 @@ Packages come from `.chezmoidata/packages.yaml` and are installed by `run_onchan
|
|||||||
| [bat](/tools/bat) | bat | `dot_config/bat/` | cyberdream tmTheme |
|
| [bat](/tools/bat) | bat | `dot_config/bat/` | cyberdream tmTheme |
|
||||||
| [Topgrade](/tools/topgrade) | topgrade | `dot_config/topgrade.toml` | n/a |
|
| [Topgrade](/tools/topgrade) | topgrade | `dot_config/topgrade.toml` | n/a |
|
||||||
| [Hunk](/tools/hunk) | hunk diff viewer | `dot_config/hunk/config.toml` | `auto` |
|
| [Hunk](/tools/hunk) | hunk diff viewer | `dot_config/hunk/config.toml` | `auto` |
|
||||||
|
| [television](/tools/television) | tv fuzzy picker, custom cables | `television/` (symlinked) | `cyberdream-transparent` |
|
||||||
| [LeetCode](/tools/leetcode) | leetcode CLI, `lc-elir` | `dot_leetcode/` | n/a |
|
| [LeetCode](/tools/leetcode) | leetcode CLI, `lc-elir` | `dot_leetcode/` | n/a |
|
||||||
|
|
||||||
<CardGroup cols={2}>
|
<CardGroup cols={2}>
|
||||||
@@ -45,7 +46,7 @@ These packages are declared in `.chezmoidata/packages.yaml` but have no config f
|
|||||||
|
|
||||||
| Tool | Role | Wired in |
|
| Tool | Role | Wired in |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `fzf` | Fuzzy finder | `FZF_DEFAULT_OPTS` in `dot_config/fish/conf.d/10-env.fish` (rounded border, cyberdream colors: highlight `#5ef1ff`, pointer `#ffaecf`, marker `#5eff6c`). Used by fish functions `c2p`, `cp-appid`, `fab`, `gtm`, `mdp`, `lc-elir`, by `~/.local/bin` scripts (`gho`, `pj`, `lc-elir`), and as `fuzzy_cmd` of the yazi bunny plugin. |
|
| `fzf` | Fuzzy finder | `FZF_DEFAULT_OPTS` in `dot_config/fish/conf.d/10-env.fish` (rounded border, cyberdream colors: highlight `#5ef1ff`, pointer `#ffaecf`, marker `#5eff6c`). Used by fish functions `c2p`, `cp-appid`, `fab`, `gtm`, `mdp`, `lc-elir`, by `~/.local/bin` scripts (`lc-elir`), and as `fuzzy_cmd` of the yazi bunny plugin. The shell pickers (`gho`, `pj`, <kbd>ctrl-e</kbd>) use [television](/tools/television). |
|
||||||
| `fd` | File finder | `c2p`, `cp-appid`, `extract_agents`, `mdp`, `lc-elir`, `conf.d/pnpm-filter.fish`. |
|
| `fd` | File finder | `c2p`, `cp-appid`, `extract_agents`, `mdp`, `lc-elir`, `conf.d/pnpm-filter.fish`. |
|
||||||
| `ripgrep` | Content search | `cp-appid`, `gtm`, `gh-sonr-org-migrate` fish functions; niri focus script. |
|
| `ripgrep` | Content search | `cp-appid`, `gtm`, `gh-sonr-org-migrate` fish functions; niri focus script. |
|
||||||
| `zoxide` | Frecency `cd` | `zoxide init fish` in `conf.d/40-tools.fish`; the `cd` function in fish/bash/zsh falls back to `zoxide query` when the argument is not a directory, and `ghg-clone` registers new clones. |
|
| `zoxide` | Frecency `cd` | `zoxide init fish` in `conf.d/40-tools.fish`; the `cd` function in fish/bash/zsh falls back to `zoxide query` when the argument is not a directory, and `ghg-clone` registers new clones. |
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default defineMeta({
|
|||||||
"lazygit",
|
"lazygit",
|
||||||
"lazydocker",
|
"lazydocker",
|
||||||
"bat",
|
"bat",
|
||||||
|
"television",
|
||||||
"topgrade",
|
"topgrade",
|
||||||
"hunk",
|
"hunk",
|
||||||
"leetcode",
|
"leetcode",
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
---
|
||||||
|
title: television
|
||||||
|
description: tv config symlinked from the repo, a transparent cyberdream theme, and the custom cables behind gho, pj, and ctrl-e in fish, zsh, and bash.
|
||||||
|
---
|
||||||
|
|
||||||
|
[television](https://github.com/alexpasmantier/television) (`tv`) is a fuzzy picker built on "cables": TOML files that define a source command, a preview, and actions. Every shell picker in the repo runs on a tv cable, with the same keys in fish, zsh, and bash.
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| Source | `television/config.toml`, `television/cable/*.toml`, `television/themes/cyberdream-transparent.toml` |
|
||||||
|
| Link | `dot_config/symlink_television.tmpl` → `~/.config/television` is a symlink to `{{ .chezmoi.sourceDir }}/television` |
|
||||||
|
| Target | `~/.config/television/` |
|
||||||
|
| Ignore | `.chezmoiignore.tmpl` lists `television`, so it is not copied to `~/television` |
|
||||||
|
| Install | Not listed in `.chezmoidata/packages.yaml`; install separately |
|
||||||
|
|
||||||
|
The whole directory is a symlink into the source tree, so edits apply without `chezmoi apply`. `cable/` holds tv's stock cables plus the repo's own and overridden ones.
|
||||||
|
|
||||||
|
## config.toml
|
||||||
|
|
||||||
|
| Key | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| `default_channel` | `files` |
|
||||||
|
| `ui.theme` | `cyberdream-transparent` |
|
||||||
|
| `ui.input_bar.position` | `top`, prompt `>` |
|
||||||
|
| Borders | `rounded` on the input bar, results, and preview |
|
||||||
|
| `ui.preview_panel.size` | `50` |
|
||||||
|
| `ui.help_panel.hidden` | `true` |
|
||||||
|
|
||||||
|
Global keys added on top of the defaults:
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
| --- | --- |
|
||||||
|
| <kbd>ctrl-e</kbd> | `actions:edit`: the channel's `edit` action |
|
||||||
|
| <kbd>ctrl-h</kbd> | `actions:goto_parent_dir`; the help panel loses <kbd>ctrl-h</kbd> |
|
||||||
|
| <kbd>end</kbd> | `go_to_input_end` (unchanged) |
|
||||||
|
|
||||||
|
## Theme
|
||||||
|
|
||||||
|
`themes/cyberdream-transparent.toml` is a separate file because tv 0.15's builtin `cyberdream` shadows a user theme of the same name and paints an opaque `#16181a` background. This theme omits `background`, so kitty's translucent background shows through (tv 0.15 rejects `background = 'none'`).
|
||||||
|
|
||||||
|
| Key | Color |
|
||||||
|
| --- | --- |
|
||||||
|
| `border_fg` | `#3c4048` |
|
||||||
|
| `text_fg`, `input_text_fg`, `result_value_fg` | `#ffffff` |
|
||||||
|
| `dimmed_text_fg` | `#7b8496` |
|
||||||
|
| `result_name_fg` | `#5ea1ff` |
|
||||||
|
| `result_line_number_fg` | `#f1ff5e` |
|
||||||
|
| `match_fg` | `#5ef1ff` |
|
||||||
|
| `selection_fg` / `selection_bg` | `#5eff6c` on `#3c4048` |
|
||||||
|
| `preview_title_fg` | `#ffaecf` |
|
||||||
|
| `result_count_fg` | `#ffbd5e` |
|
||||||
|
| `channel_mode_bg` | `#5ef1ff` on `#16181a` |
|
||||||
|
| `remote_control_mode_bg` | `#5eff6c` on `#16181a` |
|
||||||
|
| `action_picker_mode_bg` | `#bd5eff` on `#16181a` |
|
||||||
|
|
||||||
|
## Sorting
|
||||||
|
|
||||||
|
Every custom cable pipes its source through [`mtime-sort`](/shell/scripts#mtime-sort), which orders lines newest-first by the mtime of the path in the line's last tab-separated field (`--repo` stats `<path>/.git/index` first). tv then ranks match quality and frecency on top of that order. All custom cables set `shell = "bash"`, because `$SHELL` is fish.
|
||||||
|
|
||||||
|
## Custom cables
|
||||||
|
|
||||||
|
| Cable | File | Opened by |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [`ghq-repos`](#ghq-repos) | `cable/ghq-repos.toml` | <kbd>ctrl-o</kbd> (`gho`) |
|
||||||
|
| [`git-files`](#git-files) | `cable/git-files.toml` | <kbd>ctrl-e</kbd> |
|
||||||
|
| [`pj`](#pj) | `cable/pj.toml` | <kbd>ctrl-p</kbd>, <kbd>down</kbd> on an empty prompt (`pj`) |
|
||||||
|
| [`files`](#files) | `cable/files.toml` | `tv`, <kbd>ctrl-t</kbd> autocomplete |
|
||||||
|
|
||||||
|
The keys are bound in fish (`fish_user_key_bindings.fish`), zsh (`keybinds.zsh`), and bash (`keybinds.bash`). See [fish](/shell/fish#key-bindings) and [bash and zsh](/shell/bash-zsh).
|
||||||
|
|
||||||
|
### ghq-repos
|
||||||
|
|
||||||
|
Entries are `name<TAB>path`: tv shows and matches the name and prints the path. <kbd>ctrl-s</kbd> cycles between the two sources.
|
||||||
|
|
||||||
|
| Source | Entries | Sort |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Repos | `ghq list` under `ghq root`, plus the chezmoi source (`~/.local/share/chezmoi`) listed as `github.com/prdlk/dotfiles` | `mtime-sort --repo` |
|
||||||
|
| Vaults | Every directory under `~/Documents/Obsidian` (depth 3) that contains `.obsidian`, named relative to that directory | `mtime-sort` |
|
||||||
|
|
||||||
|
**Preview.** `onefetch --no-art` for git directories, otherwise `eza --tree --level 2` (falling back to `ls -la`).
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
| --- | --- |
|
||||||
|
| <kbd>enter</kbd> | Print the path. The `gho` function cds into it, clears, and runs `onefetch` in git repos |
|
||||||
|
| <kbd>ctrl-e</kbd> | `edit`: `cd <path> && nvim .` on `/dev/tty` |
|
||||||
|
| <kbd>ctrl-b</kbd> | `browse`: `cd <path> && gop` in fork mode, so tv stays open ([gop](/shell/scripts#gop)) |
|
||||||
|
|
||||||
|
**Needs:** `ghq`, `fd`, `onefetch`, `mtime-sort`.
|
||||||
|
|
||||||
|
### git-files
|
||||||
|
|
||||||
|
| Source | Entries |
|
||||||
|
| --- | --- |
|
||||||
|
| Tracked | `git ls-files` of the whole repo (from the toplevel), or `fd -t f` outside a repo |
|
||||||
|
| All | `fd -t f -H -E .git` |
|
||||||
|
|
||||||
|
Both are sorted with `mtime-sort`. The preview is `bat -n` with `BAT_THEME=ansi`. <kbd>enter</kbd> runs `edit`: `nvim {}` on `/dev/tty`.
|
||||||
|
|
||||||
|
**Needs:** `git`, `fd`, `bat`, `mtime-sort`.
|
||||||
|
|
||||||
|
### pj
|
||||||
|
|
||||||
|
Source `pj --list`; tv shows the display column. The preview runs `pj --preview`, the preview panel is 40% wide, and <kbd>enter</kbd> runs `pj --run`. Running `pj` scans the project and opens this cable with its own records. See [pj](/shell/scripts#pj).
|
||||||
|
|
||||||
|
**Needs:** `pj`, `mtime-sort`.
|
||||||
|
|
||||||
|
### files
|
||||||
|
|
||||||
|
Overrides tv's stock `files` cable. Sources `Default` (`fd -t f`) and `Hidden` (`fd -t f -H`), both piped through `mtime-sort`. The `edit` action opens the selection in `nvim` on `/dev/tty`, so it also works from <kbd>ctrl-t</kbd>, where the shell captures tv's stdout.
|
||||||
|
|
||||||
|
**Needs:** `fd`, `bat`, `mtime-sort`.
|
||||||
+1
-1
@@ -103,7 +103,7 @@ All bindings in `keymap.toml` are `[[mgr.prepend_keymap]]` entries, so they take
|
|||||||
| <kbd>;</kbd> | Open the bunny hop menu |
|
| <kbd>;</kbd> | Open the bunny hop menu |
|
||||||
| <kbd>'</kbd> | Bunny fuzzy search over hops |
|
| <kbd>'</kbd> | Bunny fuzzy search over hops |
|
||||||
|
|
||||||
`$GHQ_ROOT` is `~/Code`, exported in `dot_config/fish/conf.d/10-env.fish`. The `g m` bindings need the SFTP services in `vfs.toml`, which are commented out (see [vfs.toml](#vfstoml)).
|
`$GHQ_ROOT` is `~/Code`, exported in `dot_config/fish/conf.d/10-env.fish`, `dot_zshrc`, and `dot_bashrc`. The `g m` bindings need the SFTP services in `vfs.toml`, which are commented out (see [vfs.toml](#vfstoml)).
|
||||||
|
|
||||||
### Finding and opening
|
### Finding and opening
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user