Skip to content

Instantly share code, notes, and snippets.

@LazyRen
Created March 15, 2024 01:04
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 LazyRen/92af3c17cb873ec9f69d81295a7e453f to your computer and use it in GitHub Desktop.
Save LazyRen/92af3c17cb873ec9f69d81295a7e453f to your computer and use it in GitHub Desktop.
Remove zsh history entry
# Use TAB to select entries to delete
# Run `fc -R` to reload history file from a current shell.
alias hfzf='history -w; cat ~/.zsh_history | fzf -m > /tmp/to_remove; grep -vxFf /tmp/to_remove ~/.zsh_history > ~/.new_zsh_history; mv ~/.new_zsh_history ~/.zsh_history; rm /tmp/to_remove; history -r'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment