mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-26 13:05:37 +00:00
git add fuzzy
This commit is contained in:
parent
23c84ca606
commit
7970d36fa9
@ -36,6 +36,22 @@ function gittools
|
|||||||
and git show $commit
|
and git show $commit
|
||||||
end
|
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
|
function git-merge-fuzzy
|
||||||
set branch (git-fuzzy-branch "merge from...")
|
set branch (git-fuzzy-branch "merge from...")
|
||||||
and git merge $branch
|
and git merge $branch
|
||||||
@ -56,6 +72,8 @@ function gittools
|
|||||||
switch $argv[1]
|
switch $argv[1]
|
||||||
case "checkout"
|
case "checkout"
|
||||||
git-checkout-fuzzy
|
git-checkout-fuzzy
|
||||||
|
case "add"
|
||||||
|
git-add-fuzzy
|
||||||
case "show"
|
case "show"
|
||||||
git-show-fuzzy
|
git-show-fuzzy
|
||||||
case "merge"
|
case "merge"
|
||||||
|
Loading…
Reference in New Issue
Block a user