Last active
July 5, 2024 07:45
-
-
Save o-az/47dbe8cff8ec205ecd274e681387211a to your computer and use it in GitHub Desktop.
search through files in past commits with fzf (fish)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git-fzf-log | |
git log --oneline --decorate --color=always | fzf --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \ | |
--header 'Press CTRL-S to toggle sort' \ | |
--preview 'git show --color=always {+1}' | awk '{print $1}' | |
end | |
git-fzf-log | xargs -I % git diff %^ % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git-fzf-log; git log --oneline --decorate --color=always \ | |
| fzf --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \ | |
--header 'Press CTRL-S to toggle sort' --preview 'git show --color=always {+1}' \ | |
| awk '{print $1}'; end; git-fzf-log | xargs -I % git diff %^ % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copy pasting one_line.fish directly works - no need for custom fish function if you don't want to