From c4172c75c735f54c0678d663235a77a6f71ab404 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 16 Nov 2024 22:10:31 +0800 Subject: remove: removed back less again cuz it breaks pipe (i.e. cat file | less) add: gp() function --- func.zsh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'func.zsh') diff --git a/func.zsh b/func.zsh index 27be3dc..c7a6556 100755 --- a/func.zsh +++ b/func.zsh @@ -249,21 +249,22 @@ function vim () { # fi #} -function less () { - if [ ! -e "$1" ] - then - DIR=$(dirname "$1") - OWNER=$(stat -c '%U' "$DIR") - else - OWNER=$(stat -c '%U' "$1") - fi - if [[ "$OWNER" == "root" ]] - then - sudo bat "$1" - else - bat "$1" - fi -} +# breaks pipe (i.e. cat file | less) +# function less () { +# if [ ! -e "$1" ] +# then +# DIR=$(dirname "$1") +# OWNER=$(stat -c '%U' "$DIR") +# else +# OWNER=$(stat -c '%U' "$1") +# fi +# if [[ "$OWNER" == "root" ]] +# then +# sudo bat "$1" +# else +# bat "$1" +# fi +# } # move applications function move_to_desktop { @@ -333,6 +334,15 @@ function ga () fi } +function gp () { + if [[ -n "${1+x}" ]]; then + git push -u origin $@ + else + git remote | xargs -L1 git push + fi + +} + function linuxcmd () { #$(which $@) -- cgit v1.2.3