mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +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
+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 |
|
||||
| `c` | cds when given an argument |
|
||||
| `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) |
|
||||
|
||||
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).
|
||||
|
||||
@@ -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` |
|
||||
| [`ghg-clone`](#ghg-clone) | sh | `ghq get` and print the clone 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 |
|
||||
| [`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 |
|
||||
| [`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 |
|
||||
| [`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 |
|
||||
|
||||
## 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.
|
||||
|
||||
**Needs:** `ghq` (`GHQ_ROOT=~/Code` in fish), optional `zoxide`.
|
||||
**Needs:** `ghq` (`GHQ_ROOT=~/Code`, exported by fish, zsh, and bash), optional `zoxide`.
|
||||
|
||||
## 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`.
|
||||
|
||||
## 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
|
||||
|
||||
```sh
|
||||
@@ -245,13 +228,25 @@ Lists `*.md` files up to 3 directories deep with `fd`. fzf shows an `mdfried` pr
|
||||
|
||||
**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
|
||||
|
||||
```sh
|
||||
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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
**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
|
||||
|
||||
|
||||
Reference in new issue
Block a user