🧠 Second Brain
Search
Recursive Search in Terminal with fzf (`ctrl+r`)
The videos I got it from:
- Fuzzy Search Your Bash History in Style with fzf — Nick Janetakis
- 4 Useful fzf Tricks for Your Terminal | Pragmatic Pineapple 🍍
# Installation
GitHub - junegunn/fzf: :cherry_blossom: A command-line fuzzy finder
|
|
CTRL-R
- Paste the selected command from history onto the command-line- If you want to see the commands in chronological order, press
CTRL-R
again which toggles sorting by relevance - Set
FZF_CTRL_R_OPTS
to pass additional options to fzf
- If you want to see the commands in chronological order, press
|
|
Or I added this file to my
fzf/shell/key-bindings.zsh at master · junegunn/fzf · GitHub to my zsh in ~/.fzf.zsh
(maybe that’s also done automatically through installing above fzf and zsh shell is automatically picking it up)
# Troubleshoot
# ubuntu WSL2
I had installed the fzf via apt in Lubuntu (sudo apt-get install fzf) but it didn’t work for me, so what I did was clone it to install it and that’s when the error “unknown option: –scheme=history” appeared. What I did was uninstall the fzf (sudo apt-get remove –purge fzf) immediately I pressed CRTL + R and it worked.
unknown option: –scheme=history · Issue #2996 · junegunn/fzf · GitHub
Solution, remove and reinstall with cloning from git:
|
|
If it does not work yet, try source ~/.zshrc
Origin:
Fuzzy Search Your Bash History in Style with fzf — Nick Janetakis
References:
Created 2023-03-09