mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
git add fuzzy
This commit is contained in:
parent
23c84ca606
commit
7970d36fa9
@ -36,6 +36,22 @@ function gittools
|
||||
and git show $commit
|
||||
end
|
||||
|
||||
function git-add-fuzzy
|
||||
set gitfile (git status -s \
|
||||
| fzf \
|
||||
--height 50% \
|
||||
-m \
|
||||
--preview-window right:70% \
|
||||
--preview 'set -l IFS; set gd (git diff --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2)); if test "$gd"; echo "$gd"; else; bat (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2); end')
|
||||
and for gf in $gitfile
|
||||
set gf (echo $gf \
|
||||
| awk '{$1=$1};1' \
|
||||
| cut -d' ' -f2 \
|
||||
)
|
||||
and git add $gf
|
||||
end
|
||||
end
|
||||
|
||||
function git-merge-fuzzy
|
||||
set branch (git-fuzzy-branch "merge from...")
|
||||
and git merge $branch
|
||||
@ -56,6 +72,8 @@ function gittools
|
||||
switch $argv[1]
|
||||
case "checkout"
|
||||
git-checkout-fuzzy
|
||||
case "add"
|
||||
git-add-fuzzy
|
||||
case "show"
|
||||
git-show-fuzzy
|
||||
case "merge"
|
||||
|
Loading…
Reference in New Issue
Block a user