-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show diff or file content in fzf_search_git_status
- Loading branch information
Showing
3 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function __fzf_git_diff | ||
switch (string sub --length 2 $argv[1]) | ||
# Untracked filed | ||
case '\?\?' | ||
bat $argv[2] | ||
# Deleted files, show the file content in previous commit | ||
case '?D' 'D?' | ||
git show HEAD:$argv[2] | ||
# Other files, show the diff compared to last commit (unstaged & staged changes) | ||
case '*' | ||
git diff --color HEAD $argv[2] | ||
end | ||
end |
This file contains 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