diff options
Diffstat (limited to 'alias')
| -rw-r--r-- | alias | 77 |
1 files changed, 38 insertions, 39 deletions
| @@ -14,11 +14,10 @@ alias log="cat $SETTING_DIR/log | grep '`date +'%b %d'`'" | |||
| 14 | # vim | 14 | # vim |
| 15 | alias v='vim' | 15 | alias v='vim' |
| 16 | alias vv='vim ~/vimwiki/index.md' | 16 | alias vv='vim ~/vimwiki/index.md' |
| 17 | alias ve='vim ~/.vim_runtime/my_configs.vim' | ||
| 18 | alias vr='vim -R' | 17 | alias vr='vim -R' |
| 19 | alias cdv='cd ~/.vim_runtime' # amix/vimrc repo | 18 | alias cdv='cd ~/.vim_runtime' # amix/vimrc repo |
| 20 | 19 | ||
| 21 | # script | 20 | # for custom scripts |
| 22 | vs() { | 21 | vs() { |
| 23 | which $1 && vim $(which $1) | 22 | which $1 && vim $(which $1) |
| 24 | } | 23 | } |
| @@ -55,7 +54,7 @@ prompt() { | |||
| 55 | alias ai='sudo apt install' # apt install | 54 | alias ai='sudo apt install' # apt install |
| 56 | alias aptu='sudo apt update && sudo apt upgrade' | 55 | alias aptu='sudo apt update && sudo apt upgrade' |
| 57 | alias si='sudo snap install' # snap install | 56 | alias si='sudo snap install' # snap install |
| 58 | alias pi='sudo pip3 install' # nodejs install | 57 | alias pi='sudo pip3 install' # python install |
| 59 | alias ni='sudo npm install -g' # nodejs install | 58 | alias ni='sudo npm install -g' # nodejs install |
| 60 | 59 | ||
| 61 | # cd to DIRs | 60 | # cd to DIRs |
| @@ -70,6 +69,18 @@ alias cdD='cd ~/Documents' | |||
| 70 | alias cdP='cd ~/Pictures' | 69 | alias cdP='cd ~/Pictures' |
| 71 | alias cdV='cd ~/Videos' | 70 | alias cdV='cd ~/Videos' |
| 72 | 71 | ||
| 72 | # git | ||
| 73 | unalias gc &> /dev/null # override zsh plugin alias | ||
| 74 | gc() { | ||
| 75 | git clone $1 && cd $(basename $1) | ||
| 76 | } | ||
| 77 | gc1() { | ||
| 78 | git clone --depth=1 $1 && cd $(basename $1) | ||
| 79 | } | ||
| 80 | alias gls='git log -S' | ||
| 81 | alias cdgw='cd .github/workflows' | ||
| 82 | alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule | ||
| 83 | |||
| 73 | # github | 84 | # github |
| 74 | GITHUB_API='https://api.github.com' | 85 | GITHUB_API='https://api.github.com' |
| 75 | GITHUB_API_TOKEN=$(cat $SETTING_DIR/tokens/github 2>/dev/null) | 86 | GITHUB_API_TOKEN=$(cat $SETTING_DIR/tokens/github 2>/dev/null) |
| @@ -78,11 +89,34 @@ alias github_token='xdg-open https://github.com/settings/tokens' | |||
| 78 | github() { | 89 | github() { |
| 79 | xdg-open https://github.com/$1/$2 | 90 | xdg-open https://github.com/$1/$2 |
| 80 | } | 91 | } |
| 92 | gcg() { | ||
| 93 | git clone git@github.com:$1/$2.git && cd $(basename $2) | ||
| 94 | } | ||
| 95 | github_release_asset() { | ||
| 96 | command="upload-github-release-asset.sh\n github_api_token=$GITHUB_API_TOKEN\n owner=typebrook\n repo=tig\n tag=LATEST\n filename=$(which tig)\n overwrite=false" | ||
| 97 | prompt "$command" | ||
| 98 | } | ||
| 99 | |||
| 100 | # tig | ||
| 101 | alias cdt='cd ~/git/tig' | ||
| 102 | alias t='tig' | ||
| 103 | alias ts='tig status' | ||
| 104 | alias ta='tig --all' | ||
| 105 | alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig' | ||
| 106 | upload_tig() { | ||
| 107 | upload-github-release-asset.sh \ | ||
| 108 | github_api_token=$GITHUB_API_TOKEN \ | ||
| 109 | owner=typebrook \ | ||
| 110 | repo=tig \ | ||
| 111 | tag=LATEST \ | ||
| 112 | filename=$(which tig) | ||
| 113 | overwrite=false | ||
| 114 | } | ||
| 81 | 115 | ||
| 82 | # about custom settings | 116 | # about custom settings |
| 83 | alias cds="cd $SETTING_DIR" | 117 | alias cds="cd $SETTING_DIR" |
| 84 | alias cdss="cd $SETTING_DIR/scripts" | 118 | alias cdss="cd $SETTING_DIR/scripts" |
| 85 | alias chs="cd $SETTING_DIR && tig status" # check setting changes | 119 | alias chs="cd $SETTING_DIR && tig status" |
| 86 | 120 | ||
| 87 | # about vimwiki | 121 | # about vimwiki |
| 88 | alias cdw='cd ~/vimwiki' | 122 | alias cdw='cd ~/vimwiki' |
| @@ -114,25 +148,6 @@ _ranger_cd() { | |||
| 114 | # disk | 148 | # disk |
| 115 | alias df='df -h' | 149 | alias df='df -h' |
| 116 | 150 | ||
| 117 | # git | ||
| 118 | unalias gc &> /dev/null # override zsh plugin alias | ||
| 119 | gc() { | ||
| 120 | git clone $1 && cd $(basename $1) | ||
| 121 | } | ||
| 122 | gc1() { | ||
| 123 | git clone --depth=1 $1 && cd $(basename $1) | ||
| 124 | } | ||
| 125 | gcg() { | ||
| 126 | git clone git@github.com:$1/$2.git && cd $(basename $2) | ||
| 127 | } | ||
| 128 | alias gls='git log -S' | ||
| 129 | alias cdgw='cd .github/workflows' | ||
| 130 | alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule | ||
| 131 | github_release_asset() { | ||
| 132 | command="upload-github-release-asset.sh\n github_api_token=$GITHUB_API_TOKEN\n owner=typebrook\n repo=tig\n tag=LATEST\n filename=$(which tig)\n overwrite=false" | ||
| 133 | prompt "$command" | ||
| 134 | } | ||
| 135 | |||
| 136 | # docker | 151 | # docker |
| 137 | alias dp='docker ps' | 152 | alias dp='docker ps' |
| 138 | alias dpa='docker ps -a' | 153 | alias dpa='docker ps -a' |
| @@ -149,22 +164,6 @@ alias ptt='ssh bbsu@ptt.cc' | |||
| 149 | alias geothings='ssh geothings@geobingan.info' | 164 | alias geothings='ssh geothings@geobingan.info' |
| 150 | alias geothings-test='ssh geothings@test.geothings.tw' | 165 | alias geothings-test='ssh geothings@test.geothings.tw' |
| 151 | 166 | ||
| 152 | # tig | ||
| 153 | alias cdt='cd ~/git/tig' | ||
| 154 | alias t='tig' | ||
| 155 | alias ts='tig status' | ||
| 156 | alias ta='tig --all' | ||
| 157 | alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig' | ||
| 158 | upload_tig() { | ||
| 159 | upload-github-release-asset.sh \ | ||
| 160 | github_api_token=$(cat ~/settings/tokens/github) \ | ||
| 161 | owner=typebrook \ | ||
| 162 | repo=tig \ | ||
| 163 | tag=LATEST \ | ||
| 164 | filename=$(which tig) | ||
| 165 | overwrite=false | ||
| 166 | } | ||
| 167 | |||
| 168 | # Android | 167 | # Android |
| 169 | alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_' | 168 | alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_' |
| 170 | alias adb_default='adb shell dumpsys package domain-preferred-apps' | 169 | alias adb_default='adb shell dumpsys package domain-preferred-apps' |