From aed2f4c5dfc2c6c3247230ee1036828b7a345089 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Thu, 15 Oct 2026 13:18:40 +0200 Subject: [PATCH] [ZSH] fzf history search on servers Co-Authored-By: Claude Opus 5.5 --- setup_ubuntu.sh | 2 +- setup_ubuntu_shared.zsh | 2 +- zsh/.zshrc | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index 65f28a4..e5fc8ef 100755 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -9,7 +9,7 @@ shopt -s nullglob sudo apt -y update sudo apt -y dist-upgrade -sudo apt -y install curl zsh tmux virtualenvwrapper powerline fonts-powerline python3 python3-pip python3-pynvim +sudo apt -y install curl zsh tmux virtualenvwrapper powerline fonts-powerline python3 python3-pip python3-pynvim fzf sudo snap install --classic nvim ./clone_and_link.sh; true if [ $SHELL != "/bin/zsh" ]; then diff --git a/setup_ubuntu_shared.zsh b/setup_ubuntu_shared.zsh index 68c5e81..a69747d 100755 --- a/setup_ubuntu_shared.zsh +++ b/setup_ubuntu_shared.zsh @@ -7,7 +7,7 @@ # sudo apt -y update sudo apt -y dist-upgrade -sudo apt -y install curl zsh tmux virtualenvwrapper powerline fonts-powerline python3 python3-pip python3-pynvim +sudo apt -y install curl zsh tmux virtualenvwrapper powerline fonts-powerline python3 python3-pip python3-pynvim fzf sudo snap install --classic nvim ./clone_and_link.sh shared; true if [ $SHELL != "/bin/zsh" ]; then diff --git a/zsh/.zshrc b/zsh/.zshrc index dd87330..5a38c23 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -49,6 +49,19 @@ export SSH_REAL_SOCK=$SSH_AUTH_SOCK source "${ZDOTDIR:-$HOME}/.zsh/lib/interactive.zsh" +# fzf keys (Ctrl-R/Ctrl-T/Alt-C, **); after antidote, whose vi-mode rebinds ^R. +# --zsh needs fzf >= 0.48; older apt builds ship the scripts instead. +if (( $+commands[fzf] && ! shared_config )); then + if _fzf_init=$(fzf --zsh 2>/dev/null); then + eval "$_fzf_init" + else + for _fzf_init in /usr/share/doc/fzf/examples/{key-bindings,completion}.zsh; do + [[ -r $_fzf_init ]] && source $_fzf_init + done + fi + unset _fzf_init +fi + export LIBVIRT_DEFAULT_URI="qemu:///system" if (( ! shared_config )); then # Agent shells: