summaryrefslogtreecommitdiff
path: root/func.zsh
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-11-16 22:10:31 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-11-16 22:10:31 +0800
commitc4172c75c735f54c0678d663235a77a6f71ab404 (patch)
tree8cf982402b94613b7cb8695ecd5ce81f4b1158aa /func.zsh
parent53bca8cfa7d0edcc286a60c8c00a1030f4e9a414 (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-xfunc.zsh40
1 files changed, 25 insertions, 15 deletions
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 $@)