From 015027ed3b8ce92229dd44e3a6bc869fa5befb89 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Tue, 20 Oct 2026 12:18:22 +0200 Subject: [PATCH] [ZSH] Add atuin history with cwd, own Ctrl-R Co-Authored-By: Claude Opus 5.5 --- .config/atuin/config.toml | 7 +++++++ AGENTS.md | 2 +- setup_arch.sh | 2 +- setup_mac.sh | 2 +- zsh/.zshrc | 11 +++++++++++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .config/atuin/config.toml diff --git a/.config/atuin/config.toml b/.config/atuin/config.toml new file mode 100644 index 0000000..02d4f5f --- /dev/null +++ b/.config/atuin/config.toml @@ -0,0 +1,7 @@ +## Overrides only; all defaults: `atuin default-config` + +## brew/pacman handle updates; no version check against api.atuin.sh +update_check = false + +## Enter puts the command on the prompt for editing (like fzf) instead of running it +enter_accept = false diff --git a/AGENTS.md b/AGENTS.md index e971052..3082ab5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ Practical rule: **edit the `.example` source, not the generated symlink target.* ## Component architecture -- **zsh** (`zsh/.zshrc`): Powerlevel10k instant prompt + [antidote](https://github.com/mattmc3/antidote) plugin manager (plugin list in `zsh/.zsh_plugins.txt`). `.zshrc` sources optional layered configs if present: `.powerline_config`, `.user_config`, `.virtual_env_config.zsh`, `.mac_config.zsh`, `.local_config`. `update_dotfiles()` auto-`git pull`s this repo in the background on every shell start. Machine-local overrides belong in `.local_config` (not committed). +- **zsh** (`zsh/.zshrc`): Powerlevel10k instant prompt + [antidote](https://github.com/mattmc3/antidote) plugin manager (plugin list in `zsh/.zsh_plugins.txt`). `.zshrc` sources optional layered configs if present: `.powerline_config`, `.user_config`, `.virtual_env_config.zsh`, `.mac_config.zsh`, `.local_config`. `update_dotfiles()` auto-`git pull`s this repo in the background on every shell start. Machine-local overrides belong in `.local_config` (not committed). [atuin](https://github.com/atuinsh/atuin) records history with cwd/exit code and owns Ctrl-R (over fzf); its config is `.config/atuin/config.toml` via `ATUIN_CONFIG_DIR`, data stays in `~/.atuin`. - **nvim** (`nvim/init.vim`): [vim-plug](https://github.com/junegunn/vim-plug), auto-bootstrapped on first launch (`:PlugInstall`). Python provider points at the `~/python-envs/neovim` virtualenv on Apple Silicon. `colors/` holds a large bundled colorscheme collection. - **tmux** (`tmux/.tmux.conf`): TPM-style `plugins/`. `tmux/tmux_attach.sh` is an attach helper. On macOS, `.mac_config` binds `prefix+P` to `tmux/op_password_paste.zsh` (pastes a 1Password password into the pane, e.g. remote sudo; needs the `op` CLI with app integration). - **alacritty** (`.config/alacritty/`): active theme selected via the `import = [...]` line in `alacritty.toml`. diff --git a/setup_arch.sh b/setup_arch.sh index 1586ae5..71bad6c 100755 --- a/setup_arch.sh +++ b/setup_arch.sh @@ -9,7 +9,7 @@ set -e sudo pacman --needed -Sy archlinux-keyring --noconfirm sudo pacman --needed -Syu --noconfirm -sudo pacman --needed -Sy base-devel gnome neovim zsh tmux openssh alacritty powerline-fonts otf-firamono-nerd prettier python-pip python-pynvim --noconfirm +sudo pacman --needed -Sy base-devel gnome neovim zsh tmux openssh alacritty powerline-fonts otf-firamono-nerd prettier python-pip python-pynvim atuin --noconfirm ./clone_and_link.sh ./copy_fonts_arch.sh diff --git a/setup_mac.sh b/setup_mac.sh index fc6c6d2..7219769 100755 --- a/setup_mac.sh +++ b/setup_mac.sh @@ -6,7 +6,7 @@ # Distributed under terms of the MIT license. # -brew install neovim tmux coreutils cmake golang jq npm prettier virtualenvwrapper fzf git-delta skills +brew install neovim tmux coreutils cmake golang jq npm prettier virtualenvwrapper fzf atuin git-delta skills brew install --cask font-fira-mono-nerd-font 1password-cli ./install_alacritty_mac.sh BREW_PREFIX="$(brew --prefix)" diff --git a/zsh/.zshrc b/zsh/.zshrc index 1f07f77..009f134 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -62,6 +62,17 @@ VI_MODE_SET_CURSOR=true source $REPLY _zst_mark fzf +# atuin: history with cwd/exit code; after fzf so its Ctrl-R wins. Keeps up-arrow +# and ? (no Atuin AI). +if (( $+commands[atuin] )); then + export ATUIN_CONFIG_DIR=~/dotfiles/.config/atuin + _zsh_cached atuin.zsh ${commands[atuin]:A} $ATUIN_CONFIG_DIR/config.toml \ + -- atuin init zsh --disable-up-arrow --disable-ai && source $REPLY + # no `atuin search` spawn per keystroke (autosuggest runs synchronously) + ZSH_AUTOSUGGEST_STRATEGY=(${ZSH_AUTOSUGGEST_STRATEGY:#atuin}) +fi +_zst_mark atuin + [[ -f ~/.zsh/.mac_config.zsh ]] && source ~/.zsh/.mac_config.zsh _zst_mark mac-config # deps: go binary and `go env -w` files (macOS, Linux)