Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fuzzy find and execute command from history
# Fuzzy history
hist() {
local cmd
cmd=$(history | sed -E 's/[0-9]+\ \ //g' | sort -u | grep '^[^\ ]' | fzf --no-multi) &&
echo "\$ $cmd" &&
command $cmd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment