Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Last active July 23, 2020 05:54
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 palaniraja/acc542c3a7eac01476e4a47f340d2b1c to your computer and use it in GitHub Desktop.
Save palaniraja/acc542c3a7eac01476e4a47f340d2b1c to your computer and use it in GitHub Desktop.
fzf - to search history
fh() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac --height "40%" | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}
# and try fh to filter the history with fzf
# source: https://armno.in.th/2020/01/16/fzf-history/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment