mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 11:32:42 +00:00
revert(shell): move iris integration to the iris branch
Reverts43dfe48,0692ae3,e0cdcd6and the cable-description half of098da70(the star-prompt stats stay). master returns to the pre-iris shell setup: atuin in fish/zsh/bash, the down -> pj binding with PJ_QUIET, and the fish/zsh key bindings as they were. The iris work lives on the `iris` branch.
This commit is contained in:
1 parent
098da702fc
commit
2049f580f0
27 files changed
+237
-408
No files matched your search
+40
-7
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: atuin
|
||||
description: Shell history search for bash with a daemon, directory-scoped up-arrow, tmux popups, and a cyberdream theme.
|
||||
description: Shell history search with a daemon, directory-scoped up-arrow, tmux popups, a cyberdream theme, and the atuin AI inline command generator.
|
||||
---
|
||||
|
||||
[atuin](https://atuin.sh) replaces shell history search in bash. fish and zsh do not use it: [iris](/shell/iris) wraps both and takes <kbd>up</kbd>, <kbd>down</kbd>, and <kbd>ctrl-r</kbd> itself, so the two fought over the same keys.
|
||||
[atuin](https://atuin.sh) replaces shell history search in fish, bash, and zsh. It also provides `atuin ai inline`, a natural-language command generator that the fish config binds to keys.
|
||||
|
||||
| Source (repo) | Target | Notes |
|
||||
| --- | --- | --- |
|
||||
@@ -15,9 +15,12 @@ chezmoi runs in symlink mode, but `private_` files are written as real files, so
|
||||
|
||||
## Installation
|
||||
|
||||
`atuin` is listed in `.chezmoidata/packages.yaml` for pacman and Homebrew. bash also expects atuin's standalone installer layout in `~/.atuin/bin`: it runs `. "$HOME/.atuin/bin/env"` just before `atuin init`.
|
||||
`atuin` is listed in `.chezmoidata/packages.yaml` for pacman and Homebrew. The shells also expect atuin's standalone installer layout in `~/.atuin/bin`:
|
||||
|
||||
That line does not check that the file exists, so a machine without `~/.atuin/bin` prints a sourcing error at shell start.
|
||||
- fish: `conf.d/atuin.env.fish` sources `~/.atuin/bin/env.fish`.
|
||||
- bash and zsh: `. "$HOME/.atuin/bin/env"` just before `atuin init`.
|
||||
|
||||
Neither line checks that the file exists, so a machine without `~/.atuin/bin` prints a sourcing error at shell start.
|
||||
|
||||
### atuin-receipt.json
|
||||
|
||||
@@ -37,21 +40,51 @@ The receipt that atuin's [cargo-dist](https://opensource.axo.dev/cargo-dist/) in
|
||||
|
||||
| Shell | Where | What |
|
||||
| --- | --- | --- |
|
||||
| fish | `config.fish`, interactive only | `atuin init fish \| source`, `atuin ai init fish \| source`, and the `?` binding |
|
||||
| fish | `functions/fish_user_key_bindings.fish` | <kbd>ctrl-w</kbd> runs `atuin ai inline` |
|
||||
| bash | end of `~/.bashrc` | `eval "$(atuin init bash)"` |
|
||||
| zsh | end of `~/.zshrc` | `eval "$(atuin init zsh)"` |
|
||||
|
||||
In fish, `40-tools.fish` sources hishtory before atuin, but atuin's init runs later in `config.fish` and takes <kbd>ctrl-r</kbd>. zsh also loads `suv init zsh` (suvadu) if installed.
|
||||
|
||||
### Key bindings
|
||||
|
||||
| Key | Shells | Action |
|
||||
| --- | --- | --- |
|
||||
| <kbd>ctrl-r</kbd> | bash | Interactive search (`_atuin_search`) |
|
||||
| <kbd>up</kbd> | bash | Search opened from the up arrow. `filter_mode_shell_up_key_binding = "directory"` limits it to history from the current directory |
|
||||
| <kbd>ctrl-r</kbd> | all | Interactive search (`_atuin_search`) |
|
||||
| <kbd>up</kbd> | all | Search opened from the up arrow. `filter_mode_shell_up_key_binding = "directory"` limits it to history from the current directory |
|
||||
| <kbd>?</kbd> | fish, vi normal mode | On an empty buffer, runs `atuin ai inline --hook` |
|
||||
| <kbd>ctrl-w</kbd> | fish, insert and normal mode | `atuin ai inline`, then repaint |
|
||||
| <kbd>ctrl+shift+p</kbd> | kitty | [`atuin-pick`](/shell/scripts#atuin-pick): directory-filtered search in a split, running the pick in a fresh fish |
|
||||
|
||||
Under tmux, atuin's `[tmux]` settings open the search in a tmux popup (80% wide, 60% tall) instead of inline.
|
||||
|
||||
## AI inline
|
||||
|
||||
`atuin ai` is enabled in the config (`[ai] enabled = true`), but no shell loads `atuin ai init` or binds a key to it any more: the fish integration (<kbd>?</kbd> and <kbd>ctrl-w</kbd>) was removed with the move to iris. Run `atuin ai inline` by hand to use it.
|
||||
Commit `a82921c` ("add Atuin AI inline integration and keybinding") added the <kbd>ctrl-w</kbd> bind to `fish_user_key_bindings.fish` and the following to `config.fish`:
|
||||
|
||||
1. `atuin ai init fish | source`, in the interactive block next to `atuin init fish`.
|
||||
2. A copy of the `_atuin_ai_question_mark` function that `atuin ai init fish` prints, and `bind "?" _atuin_ai_question_mark`.
|
||||
|
||||
The config also sets `[ai] enabled = true`.
|
||||
|
||||
`_atuin_ai_question_mark` works like this:
|
||||
|
||||
- **Buffer empty (or just `?`):** clears the line, prints OSC `133;C` to `/dev/tty` to close the terminal's semantic prompt zone (so shell-integrated terminals do not erase the TUI during a prompt reflow), then runs `atuin ai inline --hook` with stdout and stderr swapped. The TUI draws on the terminal, and the result comes back tagged:
|
||||
|
||||
| Output prefix | Effect |
|
||||
| --- | --- |
|
||||
| `__atuin_ai_print__:` | Print the text, repaint |
|
||||
| `__atuin_ai_cancel__` | Repaint only |
|
||||
| `__atuin_ai_execute__:` | Put the command on the line and execute it |
|
||||
| `__atuin_ai_insert__:` | Put the command on the line for editing |
|
||||
| anything else, non-empty | Put it on the line for editing |
|
||||
|
||||
- **Buffer not empty:** inserts a literal `?` under emacs bindings. Under vi or hybrid bindings, which this config uses, it does nothing.
|
||||
|
||||
`bind "?"` in `config.fish` has no `-M` flag, so it applies to fish's `default` mode, which is vi **normal** mode here. In insert mode <kbd>?</kbd> types a question mark. To ask for a command, press <kbd>Esc</kbd> and then <kbd>?</kbd> on an empty line, or press <kbd>ctrl-w</kbd> from either mode. The <kbd>ctrl-w</kbd> bind calls `atuin ai inline` without `--hook` and replaces fish's default <kbd>ctrl-w</kbd> word deletion.
|
||||
|
||||
bash and zsh do not load `atuin ai init`.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
Reference in new issue
Block a user