mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-14 16:32:56 +00:00
16 lines
543 B
Fish
16 lines
543 B
Fish
|
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 --color=always (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
|