all repos — dotfiles @ 2ddee78e08cae7860ea50324848541ddd109d4b2

my *nix dotfiles

nix/fish: rewrite bash functions in fish

Thanks AI.
Anirudh Oppiliappan x@icyphox.sh
Fri, 07 Jun 2024 14:19:19 +0300
commit

2ddee78e08cae7860ea50324848541ddd109d4b2

parent

ca6460079249e87c901ed23fe4c7e1bbea104360

1 files changed, 29 insertions(+), 0 deletions(-)

jump to
M programs/fish.nixprograms/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";