nix/fish: rewrite bash functions in fish Thanks AI.
Anirudh Oppiliappan x@icyphox.sh
Fri, 07 Jun 2024 14:19:19 +0300
1 files changed,
29 insertions(+),
0 deletions(-)
jump to
M
programs/fish.nix
→
programs/fish.nix
@@ -13,6 +13,35 @@ functions = {
fish_prompt = '' printf '\n\001\002▲\001\002 ' ''; + ggp = '' + if test "$argv[1]" = "-f" + git push (git remote show) -f (git branch --show-current) + else + git push (git remote show) (git branch --show-current) + end + ''; + + gpl = '' + if test -n "$argv[1]" + set branch $argv[1] + else + set branch (git branch --show-current) + end + git pull -r (git remote show) $branch + ''; + + gco = '' + if test -z "$argv[1]" + return 1 + end + + git rev-parse --verify $argv[1] > /dev/null 2>&1 + if test $status -eq 0 + git checkout $argv[1] + else + git checkout -b $argv[1] + end + ''; }; shellAbbrs = { gc = "git commit -v -S";