diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-11-16 22:10:31 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-11-16 22:10:31 +0800 |
| commit | c4172c75c735f54c0678d663235a77a6f71ab404 (patch) | |
| tree | 8cf982402b94613b7cb8695ecd5ce81f4b1158aa /func.zsh | |
| parent | 53bca8cfa7d0edcc286a60c8c00a1030f4e9a414 (diff) | |
remove: removed back less again cuz it breaks pipe (i.e. cat file | less)
add: gp() function
Diffstat (limited to 'func.zsh')
| -rwxr-xr-x | func.zsh | 40 |
1 files changed, 25 insertions, 15 deletions
@@ -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 $@) |
