Skip to content

Integrate fzf, zoxide, and ripgrep for enhanced shell workflow#72

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/integrate-fzf-zoxide-ripgrep
Draft

Integrate fzf, zoxide, and ripgrep for enhanced shell workflow#72
Copilot wants to merge 4 commits intomasterfrom
copilot/integrate-fzf-zoxide-ripgrep

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 29, 2026

Replaces oh-my-zsh z plugin with zoxide (Rust-based, faster) and adds fzf fuzzy finder with ripgrep backend for interactive history/file/directory navigation.

Installation

script/install.d/24-fzf-zoxide-ripgrep.sh (new)

  • Multi-platform support: brew, apt, pacman, dnf
  • Idempotent checks via command -v
  • Zoxide on apt uses curl installer (package repos often outdated)

Shell Configuration

files/home/.zshrc

  • Removed z from oh-my-zsh plugins array
  • _dots_load_fzf(): Sources key bindings with fallbacks for old versions and multiple install paths
  • _dots_load_zoxide(): Initializes zoxide with fzf integration
  • FZF environment variables set before loading fzf to ensure Ctrl+T uses ripgrep from initialization:
    export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git"'
    export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

files/home/.aliases

  • alias ji='zi' for interactive directory picker (zoxide + fzf)

Keybindings Enabled

  • Ctrl+R: Fuzzy history search
  • Ctrl+T: Fuzzy file picker (ripgrep backend)
  • Alt+C: Fuzzy directory navigation
  • j <query>: Smart directory jump (existing alias, now powered by zoxide)
  • ji: Interactive directory picker (new)

Tests

tests/test_binaries.py

  • Added fzf, zoxide, rg to binaries list
Original prompt

Overview

Integrate fzf, zoxide, and ripgrep into the dotfiles setup to improve shell workflow:

  • fzf: Interactive fuzzy finder for history search (Ctrl+R), file picker (Ctrl+T), and directory navigation (Alt+C)
  • zoxide: Faster, Rust-based replacement for the current oh-my-zsh z plugin with native fzf integration
  • ripgrep: Fast file content search, optionally used as fzf's file search backend

Requirements

Installation Scripts

Create script/install.d/XX-fzf.sh, script/install.d/XX-zoxide.sh, and script/install.d/XX-ripgrep.sh (or combine logically) following existing patterns:

  • Support all package managers: brew (macOS), apt (Debian/Ubuntu/Codespaces), pacman (Arch), dnf (Fedora)
  • Skip in Codespaces if pre-installed
  • Follow idempotent installation pattern (check command -v before installing)
  • Log version after installation

Shell Configuration Changes

In files/home/.zshrc:

  1. Remove z from oh-my-zsh plugins array (currently in _dots_load_omz):

    plugins=(
        # z  # replaced by zoxide
        zsh-autosuggestions
        zsh-syntax-highlighting
    )
  2. Add fzf initialisation (load immediately, not lazy — key bindings must be available):

    _dots_load_fzf() {
        if command -v fzf &>/dev/null; then
            source <(fzf --zsh 2>/dev/null) || {
                # Fallback for older fzf versions
                local fzf_base="${HOMEBREW_PREFIX:-/opt/homebrew}/opt/fzf/shell"
                [[ -f "$fzf_base/key-bindings.zsh" ]] && source "$fzf_base/key-bindings.zsh"
                [[ -f "$fzf_base/completion.zsh" ]] && source "$fzf_base/completion.zsh"
                # Linux locations
                [[ -f /usr/share/fzf/key-bindings.zsh ]] && source /usr/share/fzf/key-bindings.zsh
                [[ -f /usr/share/fzf/completion.zsh ]] && source /usr/share/fzf/completion.zsh
            }
        fi
    }
    _dots_load_fzf
  3. Add zoxide initialisation (load immediately — low overhead ~3-5ms):

    _dots_load_zoxide() {
        command -v zoxide &>/dev/null && eval "$(zoxide init zsh)"
    }
    _dots_load_zoxide
  4. Optional: Configure fzf to use ripgrep for file search:

    if command -v rg &>/dev/null; then
        export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git"'
        export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
    fi

Aliases

In files/home/.aliases, the existing alias j='z' will continue to work with zoxide. Add:

alias ji='zi'  # interactive directory jump with fzf

Tests

Update tests/test_binaries.py to include the new binaries:

binaries: List[Text] = [
    # ... existing entries ...
    "fzf",
    "zoxide",
    "rg",  # ripgrep binary name
]

Constraints (from ADRs)

  • Startup time: Must remain under 200ms. Benchmark before/after with ZSH_BENCH=1 zsh
  • Cross-platform: Support macOS, Debian, Arch, Fedora, GitHub Codespaces
  • Naming convention: Use _dots_ prefix for all custom functions
  • No lazy loading for fzf: Key bindings must be immediately available for Ctrl+R
  • Idempotency: All install scripts must be safe to re-run
  • Prefer native package managers: Use brew/apt/pacman/dnf as appropriate per platform

Acceptance Criteria

  • fzf, zoxide, and rg binaries are installed on all platforms
  • Ctrl+R opens fzf-powered history search
  • Ctrl+T opens fzf-powered file picker
  • Alt+C opens fzf-powered directory picker
  • j <query> jumps to matching directory (zoxide)
  • ji opens interactive fzf directory picker (zoxide + fzf)
  • Shell startup time remains under 200ms
  • All existing tests pass
  • New binaries are tested in test_binaries.py

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 29, 2026 18:36
Co-authored-by: andrejusk <7396847+andrejusk@users.noreply.github.com>
Co-authored-by: andrejusk <7396847+andrejusk@users.noreply.github.com>
Co-authored-by: andrejusk <7396847+andrejusk@users.noreply.github.com>
Copilot AI changed the title [WIP] Integrate fzf, zoxide, and ripgrep into dotfiles setup Integrate fzf, zoxide, and ripgrep for enhanced shell workflow Jan 29, 2026
Copilot AI requested a review from andrejusk January 29, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants