Skip to content

Instantly share code, notes, and snippets.

@slonoed
Created May 26, 2018 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slonoed/d3991c57add516d2ebaca78e8e7da5ba to your computer and use it in GitHub Desktop.
Save slonoed/d3991c57add516d2ebaca78e8e7da5ba to your computer and use it in GitHub Desktop.
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