fzf is a general-purpose command-line fuzzy finder
- speed
- rich feature set
- highly customizable
- its really fast
Use homebrew to install fzf:
brew install fzf
If you want to use shell extensions:
/usr/local/opt/fzf/install
which are:
- Key bindings (
CTRL-T
,CTRL-R
, andALT-C
) (bash, zsh, fish) - Fuzzy auto-completion (bash, zsh)
hit tab (↹) after:
vim **
or
subl **
ssh **
Note: for more fuzzy search things head over official repo
Note: original blog post
Open up shell config (most likely ~/.zshrc
or command zshconfig
) and add following function:
# ch - browse chrome history
ch() {
local cols sep
cols=$(( COLUMNS / 3 ))
sep='{::}'
cp -f ~/Library/Application\ Support/Google/Chrome/Profile\ 1/History /tmp/h
sqlite3 -separator $sep /tmp/h \
"select substr(title, 1, $cols), url
from urls order by last_visit_time desc" |
awk -F $sep '{printf "%-'$cols's \x1b[36m%s\x1b[m\n", $1, $2}' |
fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs open
}
Note: Ensure that path to
History
file is correct; read more information on StackOverflow
- junegunn for writing this awesome tool
Most of the text is taken from fzf repository.