mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
docs(docs): add jobs cable and ctrl‑z binding documentation
This commit is contained in:
1 parent
cb6be378c1
commit
9971d79c5c
2 files changed
+26
-4
No files matched your search
@@ -62,7 +62,7 @@ Global keys added on top of the defaults:
|
||||
|
||||
## Sorting
|
||||
|
||||
Every custom cable except `agents` (a fixed list, see [agents](#agents)) and `omp-sessions` (sorted by [`omp-session`](/shell/scripts#omp-session) itself) 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.
|
||||
Every custom cable except `agents` (a fixed list, see [agents](#agents)), `omp-sessions` (sorted by [`omp-session`](/shell/scripts#omp-session) itself), and `jobs` (fish's job order) 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
|
||||
|
||||
@@ -75,8 +75,9 @@ Every custom cable except `agents` (a fixed list, see [agents](#agents)) and `om
|
||||
| [`obsidian`](#obsidian) | `cable/obsidian.toml` | `tv obsidian` |
|
||||
| [`agents`](#agents) | `cable/agents.toml` | `tv agents` |
|
||||
| [`omp-sessions`](#omp-sessions) | `cable/omp-sessions.toml` | `tv omp-sessions`, <kbd>ctrl-a</kbd> (`omp-session`) when it has nothing to resume |
|
||||
| [`jobs`](#jobs) | `cable/jobs.toml` | <kbd>ctrl-z</kbd> in fish (`_jobs_bind`) with two or more background jobs |
|
||||
|
||||
The keys are bound in fish (`fish_user_key_bindings.fish`), zsh (`keybinds.zsh`), and bash (`keybinds.bash`); bash has no <kbd>ctrl-a</kbd> binding. See [fish](/shell/fish#key-bindings) and [bash and zsh](/shell/bash-zsh).
|
||||
The keys are bound in fish (`fish_user_key_bindings.fish`), zsh (`keybinds.zsh`), and bash (`keybinds.bash`); bash has no <kbd>ctrl-a</kbd> binding, and <kbd>ctrl-z</kbd> is fish only. See [fish](/shell/fish#key-bindings) and [bash and zsh](/shell/bash-zsh).
|
||||
|
||||
### ghq-repos
|
||||
|
||||
@@ -87,15 +88,18 @@ Entries are `name<TAB>path`: tv shows and matches the name and prints the path.
|
||||
| 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`).
|
||||
**Preview.** Two commands; <kbd>ctrl-f</kbd> cycles. The default is the commit graph for git directories: `git log --graph --all`, newest 300 commits, as short hash, relative date, subject and refs. The second is `onefetch --no-art`. Non-git directories show `eza --tree --level 2` (falling back to `ls -la`) in both.
|
||||
|
||||
[serie](https://github.com/lusingander/serie) cannot draw inside the preview pane: it is a fullscreen TUI that paints its graph with kitty images and has no print mode. <kbd>ctrl-g</kbd> opens it instead.
|
||||
|
||||
| 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)) |
|
||||
| <kbd>ctrl-g</kbd> | `history`: `serie` on `/dev/tty` in fork mode for git directories; <kbd>q</kbd> returns to the picker |
|
||||
|
||||
**Needs:** `ghq`, `fd`, `onefetch`, `mtime-sort`.
|
||||
**Needs:** `ghq`, `fd`, `git`, `serie`, `onefetch`, `mtime-sort`.
|
||||
|
||||
### git-files
|
||||
|
||||
@@ -154,3 +158,16 @@ Source `omp-session --list`: the [omp](/ai/omp) sessions of the current git repo
|
||||
The preview runs `omp-session --preview`: title, last-write time and cwd, then the text of every user and assistant message. <kbd>enter</kbd> runs `resume` in execute mode, `omp-session --resume <file>`, which `exec`s `omp --resume <file>`.
|
||||
|
||||
**Needs:** `omp-session`, `omp`.
|
||||
|
||||
### jobs
|
||||
|
||||
The current fish shell's background jobs, stopped or running, newest first. tv runs as a child process and cannot read the shell's job table, so `_jobs_bind` ([fish](/shell/fish#key-bindings)) writes it to a temp file named by `$TV_JOBS` and the source just `cat`s that file; opened any other way the list is empty. Entries are `%<id> <state> <command><TAB><id><TAB><pgid>`; <kbd>enter</kbd> prints the id and the binding runs `fg %<id>`.
|
||||
|
||||
The preview finds the job's processes by process group (procps `ps -g` matches sessions, so it filters `ps -e -o pgid,pid`) and shows the first process's cwd and start time, then `ps --forest` with PID, STAT (`T` = stopped), elapsed time, CPU, RSS, and arguments. The preview script avoids `{`/`}` because tv would parse them as templates and leave `{split:…}` unexpanded.
|
||||
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| <kbd>enter</kbd> | Print the job id; `_jobs_bind` runs `fg` on it |
|
||||
| <kbd>ctrl-d</kbd> | `kill` then `reload_source`: SIGTERM to the job's process group, then SIGCONT so a stopped job receives it. Once the group is gone (polled up to 1 s) the row is removed from `$TV_JOBS`, so the reloaded list drops it; a job that ignores SIGTERM stays listed. Fish reports the termination at the next prompt |
|
||||
|
||||
**Needs:** `ps`, fish.
|
||||
Reference in new issue
Block a user