mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 17:20:13 +00:00
more fzf utilities
This commit is contained in:
16
fish.configlink/functions/git-history.fish
Normal file
16
fish.configlink/functions/git-history.fish
Normal file
@ -0,0 +1,16 @@
|
||||
function git-history
|
||||
if not count $argv > /dev/null
|
||||
echo "Must provide filename."
|
||||
return 1
|
||||
end
|
||||
set commitline ( git log \
|
||||
--follow \
|
||||
--pretty="format:%C(auto)%ar %h%d %s" \
|
||||
-- ./$argv \
|
||||
| fzf \
|
||||
--height 100% \
|
||||
--preview "git diff --color=always (echo {} | cut -d' ' -f4)^1..(echo {} | cut -d' ' -f4) -- ./$argv" \
|
||||
)
|
||||
and set commit (echo $commitline | cut -d" " -f4)
|
||||
and echo $commit
|
||||
end
|
Reference in New Issue
Block a user