fzf functions
π FZF_RG_FD_COMPLETE_GUIDE.md π The Ultimate FZF + Ripgrep + fd Guide for Termux (2025) The Trinity of Modern CLI Tools Last Updated: October 2025 Optimized for: Termux on Android π¦ Official Repositories fzf: https://github.com/junegunn/fzf (Fuzzy Finder) ripgrep (rg): https://github.com/BurntSushi/ripgrep (Fast grep alternative) fd: https://github.com/sharkdp/fd (Fast find alternative) π Table of Contents Installation Why This Trinity? Quick Start FZF + FD Integration FZF + Ripgrep Integration The Complete Trinity Real-World Workflows Advanced Recipes Custom Functions Library Performance Optimization Termux-Specific Tips π₯ Installation Install All Three Tools in Termux # Update package lists pkg update && pkg upgrade # Install the trinity pkg install fzf ripgrep fd # Optional but highly recommended companions pkg install bat exa git # Verify installations fzf --version rg --version fd --version π― Why This Trinity? The Problem with Traditional Tools: # Slow and verbose find . -type f -name "*.js" 2>/dev/null # Limited and outdated grep -r "function" . # Not interactive locate file.txt The Modern Solution: Tool Purpose Speed Features fd Find files π 3-10x faster than find Ignores .git, colors, smart case rg Search content π 5-50x faster than grep Respects .gitignore, colors fzf Interactive filter π Instant fuzzy search Preview, multi-select, keybindings Combined Power: # Find files blazingly fast + interactive selection + live preview fd --type f | fzf --preview 'bat --color=always {}' # Search content everywhere + interactive results + jump to line rg --line-number . | fzf --delimiter : --preview 'bat --color=always {1} --highlight-line {2}' β‘ Quick Start Basic Commands fd (Fast Find) # Find all files fd # Find by name fd config # Find specific type fd -e js # JavaScript files fd -e py # Python files fd -e md # Markdown files # Find in specific directory fd config /etc # Include hidden files fd -H # Search in depth fd --max-depth 3 rg (Ripgrep) # Search in current directory rg "pattern" # Case-insensitive search rg -i "pattern" # Show line numbers rg -n "pattern" # Search specific file types rg -t js "function" rg -t py "def " # Show context (lines before/after) rg -C 3 "pattern" # Search and show file names only rg -l "pattern" fzf (Fuzzy Finder) # Basic fuzzy find fzf # With preview fzf --preview 'cat {}' # Multi-select fzf -m # Custom height fzf --height 40% π FZF + FD Integration 1. Basic File Finder (fd + fzf) # Simple file search fd --type f | fzf # With preview fd --type f | fzf --preview 'bat --color=always --style=numbers {}' # Include hidden files fd --type f --hidden | fzf --preview 'bat --color=always {}' # Exclude patterns fd --type f --exclude node_modules --exclude .git | fzf --preview 'bat {}' 2. Directory Navigation (fd + fzf) # Jump to any directory cd $(fd --type d | fzf) # With preview of directory contents cd $(fd --type d | fzf --preview 'ls -lah {}') # With tree preview (if tree is installed) cd $(fd --type d | fzf --preview 'tree -L 2 {}') # With exa preview (modern ls) cd $(fd --type d | fzf --preview 'exa -lah --icons {}') 3. File Type Specific Searches # Find and edit JavaScript files vim $(fd -e js | fzf --preview 'bat --color=always {}') # Find Python files fd -e py | fzf --preview 'bat -l python --color=always {}' # Find config files fd -e conf -e config -e yaml -e yml -e json | fzf --preview 'bat --color=always {}' # Find images fd -e jpg -e png -e gif | fzf --preview 'termux-open {}' # Find markdown files fd -e md | fzf --preview 'bat --color=always -l markdown {}' 4. Set fd as Default for fzf Add to ~/.bashrc or ~/.zshrc: ...