dotfiles/aliases

291 lines
9.8 KiB
Plaintext
Raw Normal View History

2013-07-07 21:25:47 +00:00
# Handle the fact that this file will be used with multiple OSs
platform=`uname`
if [[ $platform == 'Linux' ]]; then
2015-12-06 05:15:13 +00:00
alias l='ls -lhg --color'
alias ll='ls -lahg --color'
# Arch
2016-10-23 16:45:42 +00:00
alias flux='redshift'
alias ipconfig='ip addr'
alias ifconfig='ip addr'
alias pi='yaourt -S' # wrapper around Arch Pacman
alias po='pacman -Qdt' # see orphaned packages
alias pr='yaourt -R' # giving me trouble now
alias prr='pacman -Rdd'
alias pss='sudo pacman -Syu'
alias pu='yaourt -U'
2017-08-21 19:04:19 +00:00
# TODO add a trash alias for trash-cli?
2013-07-07 21:25:47 +00:00
elif [[ $platform == 'Darwin' ]]; then
2013-07-07 21:30:11 +00:00
alias l='ls -laG'
2015-02-24 04:34:00 +00:00
alias ls='ls -laG'
2013-07-07 21:30:11 +00:00
alias ll='ls -lG'
2017-08-21 19:04:19 +00:00
# TODO add a trash alias for trash-cli? or brew install rmtrash
2017-03-27 18:22:43 +00:00
elif [[ "${platform,,}" == *'ming'* ]]; then # convert to lowercase then compare with wildcard
2017-02-16 20:54:10 +00:00
alias python='winpty python.exe'
2017-02-18 15:49:56 +00:00
alias python3='winpty python.exe'
2017-03-27 18:22:43 +00:00
alias l='ls -ahg --color'
alias ls='ls -ahg --color'
2017-11-21 02:38:59 +00:00
alias rm='echo "use trash command instead!"'
alias rmr='echo "use trash command instead!"'
2017-08-21 19:04:19 +00:00
alias trash='recycle-bin.exe '
2017-08-28 19:28:45 +00:00
alias tt='trash '
2013-07-07 21:25:47 +00:00
fi
2013-07-07 21:30:11 +00:00
alias c='cd'
2015-10-16 05:11:24 +00:00
alias c-='cd -'
alias cd-='echo "Use c- instead"'
2013-07-07 21:30:11 +00:00
alias ..='cd ../'
alias ...='cd ../..'
alias cd..='cd ..'
alias cd...='cd ../..'
alias cd....='cd ../../..'
alias cd.....='cd ../../../..'
alias aliases='vim ~/.dotfiles/aliases'
2014-06-25 16:41:29 +00:00
alias al='aliases'
2017-11-15 16:30:00 +00:00
2017-09-08 19:53:05 +00:00
alias b='if [ -f build ]; then ./build ; else test -f build.sh && ./build.sh ; fi'
2017-10-25 15:01:42 +00:00
alias bb='if [ -f build ]; then ./build -o 1 ; else test -f build.sh && ./build.sh -o 1 ; fi'
2017-11-15 16:30:00 +00:00
alias bd='if [ -f build ]; then ./build -data 1 ; else test -f build.sh && ./build.sh -data 1 ; fi'
alias bbd='if [ -f build ]; then ./build -o 1 -data 1 ; else test -f build.sh && ./build.sh -o 1 -data 1 ; fi'
2014-05-17 19:31:36 +00:00
alias bl='brew link --overwrite'
alias bld='brew link --overwrite --dry-run'
2013-09-16 20:55:52 +00:00
alias bower='noglob bower'
2018-01-22 00:04:07 +00:00
alias br='b ; r'
alias cr='RUSTFLAGS="$RUSTFLAGS -A unused_variables -A dead_code -A unused_parens" cargo run'
2017-03-06 17:46:03 +00:00
alias crr='cargo run --release'
alias cb='RUSTFLAGS="$RUSTFLAGS -A unused_variables -A dead_code -A unused_parens" cargo build'
2017-03-06 17:46:03 +00:00
alias cbr='cargo build --release'
2017-08-24 03:35:32 +00:00
alias clrtmp='trash ~/tmp/*.bak && trash ~/tmp/*.swp'
2017-07-24 21:41:30 +00:00
alias clrtemp='clrtmp'
2016-12-12 04:53:07 +00:00
alias clipboard='xclip -selection c'
alias cloc='cloc --no3 --by-file-by-lang .'
2013-07-07 21:30:11 +00:00
alias cls=clear
2013-07-07 21:25:47 +00:00
alias code='cd ~/code'
alias cpr='cp -r'
2016-04-14 13:34:42 +00:00
alias dc='gdc'
alias dot='cd ~/.dotfiles'
2017-02-21 19:46:46 +00:00
alias pdot='cd ~/.private-dotfiles'
2013-07-07 21:30:11 +00:00
alias duh='du -csh'
2013-07-10 16:13:13 +00:00
alias f='fg'
2017-08-10 15:46:10 +00:00
alias functions='vim ~/.dotfiles/functions'
2013-07-10 16:13:13 +00:00
alias history='fc -l 1'
2014-03-07 20:00:19 +00:00
alias histroy='history'
2013-07-10 16:13:13 +00:00
alias h='heroku'
2014-06-25 16:41:29 +00:00
alias ho='heroku open'
2014-09-30 00:51:23 +00:00
alias hc='heroku config'
2014-06-25 16:41:29 +00:00
alias hca='heroku config:add'
2014-09-30 00:51:23 +00:00
alias hcu='heroku config:unset'
2015-10-16 05:11:24 +00:00
alias hcr='heroku config:unset'
alias hl='heroku logs -t -n 5000'
2016-10-31 00:52:08 +00:00
alias hmo='heroku maintenance:on'
alias hmoo='heroku maintenance:off'
2016-10-23 16:45:42 +00:00
alias hr='heroku releases'
alias hrs='heroku restart'
2016-12-16 13:46:59 +00:00
alias hscale='heroku ps:scale '
2013-07-10 16:13:13 +00:00
alias irb='irb --readline -r irb/completion'
2015-02-24 04:34:00 +00:00
alias lcc='lein clean'
alias lca='lein cljsbuild auto dev'
alias ldi='lein deps install'
alias lsd='lein start-dev'
2017-08-10 15:46:10 +00:00
alias moon='curl wttr.in/moon'
2013-07-10 16:13:13 +00:00
alias patch='git format-patch HEAD^ --stdout > patch.diff'
alias reguard='killall -9 ruby ; guard'
2018-01-22 00:04:07 +00:00
alias r='if [ -f run ]; then ./run ; else test -f run.sh && ./run.sh ; fi'
alias rb='rbenv'
2014-03-07 20:00:19 +00:00
alias rbg='rbenv gemset active'
2014-02-17 07:00:21 +00:00
alias rbp='cd $RBENV_PATH/versions/$(rbenv version | sed -e "s/ (set.*$//")'
alias rbl='cd $RBENV_PATH/versions/$(rbenv version | sed -e "s/ (set.*$//")/lib/ruby'
2017-08-21 18:26:38 +00:00
alias rc='rclone'
alias rcc='rclone copy'
function reload {
if [[ $platform == 'Linux' || $platform == 'Darwin' ]]; then
source ~/.zshrc
else
2017-08-10 15:46:10 +00:00
test -f ~/.aliases && . ~/.aliases
fi
}
2014-05-17 19:31:36 +00:00
alias rl='reload'
2016-10-23 16:45:42 +00:00
alias restart='sudo shutdown now -r'
2014-02-17 07:00:21 +00:00
alias s='cd ~/.ssh'
alias sc='vim ~/.ssh/config'
2016-12-12 04:53:07 +00:00
alias stream='streamlink --player mpv'
2016-10-23 16:45:42 +00:00
alias shutdown='sudo shutdown now'
2017-03-21 13:42:13 +00:00
alias stk='rlwrap stk-simply'
2014-09-30 00:51:23 +00:00
alias t='tree'
2017-07-24 21:41:30 +00:00
alias tag='ctags -R .'
alias tmp='cd ~/tmp'
2013-07-10 16:13:13 +00:00
alias u='cd ..'
alias v='vim'
alias vi='vim'
2014-09-30 00:51:23 +00:00
alias vh='vagrant halt'
alias vs='vagrant ssh'
alias vu='vagrant up'
alias vimrc='vim ~/.vimrc'
2016-12-12 04:53:07 +00:00
alias weather='curl wttr.in/toronto'
2018-03-15 18:39:50 +00:00
alias yt-download-1080='youtube-dl.exe -f "137+140" -o "%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s" '
alias yt-download-720='youtube-dl.exe -f "136+140" -o "%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s" '
alias tw-download-60='youtube-dl.exe -f "1080p60" -o "%(upload_date)s-%(title)s-twitch-%(id)s.%(ext)s" '
alias tw-download-720='youtube-dl.exe -f "720p-1" -o "%(upload_date)s-%(title)s-twitch-%(id)s.%(ext)s" '
alias tw-download-4k='youtube-dl.exe -f "2160p" -o "%(upload_date)s-%(title)s-twitch-%(id)s.%(ext)s" '
alias tw-download='youtube-dl.exe -f "1080p" -o "%(upload_date)s-%(title)s-twitch-%(id)s.%(ext)s" '
2013-07-07 21:30:11 +00:00
# Git
function gitCmdWrapper {
# If no args are provided then run `git status`
if [[ $# > 0 ]]; then
git $@
else
git status
fi
}
2017-11-21 04:08:51 +00:00
if [[ $platform != 'Darwin' && $platform != 'Linux' ]]; then
# Fix a weird mingw 'not a valid identifierline' error.
# Got the fix from https://github.com/Alexpux/MSYS2-packages/issues/735#issuecomment-328938800
alias git="PATH=/usr/bin git"
fi
2017-10-10 23:49:48 +00:00
2015-11-04 19:25:27 +00:00
alias am='git commit --amend'
2015-11-18 02:50:00 +00:00
alias ama='git commit --amend -C head --author'
2015-11-04 19:25:27 +00:00
alias ams='git commit -S --amend' # signed
alias ammend='echo "use am instead"'
alias amend='echo "use am instead"'
alias g='gitCmdWrapper'
2014-01-25 04:04:23 +00:00
alias ga='git add -A :/'
alias gaa='git add -A'
2016-04-14 13:34:42 +00:00
alias gaap='git add -Ap'
2013-07-07 21:30:11 +00:00
alias gau='git add --update'
2017-07-13 20:02:25 +00:00
alias gb='git branch -v'
2013-07-16 23:36:06 +00:00
alias gbd='git branch -D'
2014-05-17 19:31:36 +00:00
alias gbl='git branch --all'
2018-03-15 18:39:50 +00:00
alias gblm='git blame -wMC'
2014-09-30 00:51:23 +00:00
alias gbm='git branch -m'
2015-11-04 19:25:27 +00:00
alias gbr='git branch -rv'
2013-07-07 21:30:11 +00:00
alias gc='git commit'
2014-06-25 16:41:29 +00:00
alias gcs='git commit -S'
2013-07-07 21:25:47 +00:00
alias gcl='git clone'
alias gcm="git commit -m"
2014-06-25 16:41:29 +00:00
alias gcms="git commit -S -m"
2013-07-07 21:25:47 +00:00
alias gco='git checkout'
2017-08-21 18:26:38 +00:00
alias gco-='git checkout -'
2018-10-05 17:38:00 +00:00
git_checkout_build() {
git checkout "$1" ; b
}
alias gcoo=git_checkout_build
2013-07-16 23:36:06 +00:00
alias gcob='git checkout -b'
2014-06-25 16:41:29 +00:00
alias gcon='vi .git/config'
2013-07-07 21:30:11 +00:00
alias gcp='git cherry-pick'
2014-12-01 00:18:25 +00:00
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
2014-05-17 19:31:36 +00:00
alias gcps='git cherry-pick -n'
2013-07-07 21:25:47 +00:00
alias gd='git diff'
alias gdc='git diff --cached'
2018-03-15 18:39:50 +00:00
alias gdcc='git diff --cached -w'
2013-07-07 21:25:47 +00:00
alias gdm='git diff master'
2013-07-07 21:30:11 +00:00
alias gds='git diff --stat=160,120'
alias gdw='git diff --color-words'
alias gf='git fetch'
2015-02-24 04:34:00 +00:00
alias gfa='git fetch --all'
2014-12-01 00:18:25 +00:00
alias gfix="git commit --amend -C HEAD"
2017-08-21 18:26:38 +00:00
alias gfixx="git commit --amend -C HEAD ; gp -f"
2014-12-01 00:18:25 +00:00
alias gfixs="git commit -S -a --amend -C HEAD" # signed
2014-02-17 07:00:21 +00:00
alias gfo='git fetch origin'
alias gfm='git fetch origin master'
2015-02-24 04:34:00 +00:00
alias gfup='git fetch upstream'
2015-11-04 19:25:27 +00:00
alias ggrep='git log --all --oneline | grep '
2013-07-07 21:30:11 +00:00
alias gh="source ~/.githelpers && show_git_head"
2015-10-16 05:11:24 +00:00
alias gla='git lg --all'
alias gl='git lg -30'
alias gll='git lg'
2014-01-25 04:04:23 +00:00
alias gli='git show --pretty="format:" --name-only'
alias glog='git log'
2013-07-25 16:54:40 +00:00
alias gm='git merge'
2015-11-04 19:25:27 +00:00
alias gmnff='git merge --no-ff'
2013-07-10 16:13:13 +00:00
alias gmff='git merge --ff-only'
2015-10-16 05:11:24 +00:00
alias gmffm='git merge --ff-only master'
2014-02-17 07:00:21 +00:00
alias gmffs='git merge --ff-only --squash'
2013-07-07 21:30:11 +00:00
alias gmtheirs='git merge -Xtheirs'
2013-07-07 21:25:47 +00:00
alias gp='git push'
2014-05-17 19:31:36 +00:00
alias gpa='git push && echo "pushing tags..." && git push --tags'
2014-01-25 04:04:23 +00:00
alias gpd='git push && git push heroku master'
2014-03-07 20:00:19 +00:00
alias gpdf='gpf && gphf'
2015-10-16 05:11:24 +00:00
alias gpp='echo "Pushing Upstream master to production" && git push production master'
2015-03-21 19:13:00 +00:00
alias gppp='echo "Pushing to remotes first..." && git push origin master:master && git push upstream master:master && echo "Pushing upstream master to Production..." && git push production upstream/master:master'
alias gps='git push staging'
2015-02-24 04:34:00 +00:00
alias gpps='echo "Pushing Upstream master to staging" && git push staging upstream/master:master -f'
2014-03-07 20:00:19 +00:00
alias gppf='gpf && git push production HEAD:production -f'
2014-09-30 00:51:23 +00:00
alias gph='echo "pushing $(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3) to Heroku master" && git push heroku HEAD:master'
2014-03-07 20:00:19 +00:00
alias gphf='git push heroku master --force'
2015-10-16 05:11:24 +00:00
alias gpu='git push --set-upstream origin HEAD'
2013-07-07 21:30:11 +00:00
alias gpff='git pull --ff-only'
2015-02-24 04:34:00 +00:00
alias gplup='git pull upstream master'
2016-10-23 16:45:42 +00:00
alias gpo='git push origin'
2013-07-07 21:30:11 +00:00
alias gpom='git push origin master'
2013-07-07 21:25:47 +00:00
alias gpr='git pull --rebase'
2014-05-17 19:31:36 +00:00
alias gpt='git push --tags'
2013-07-07 21:30:11 +00:00
alias gr='git reset'
2016-04-14 13:34:42 +00:00
alias gr1='git reset HEAD^1'
2014-01-25 04:04:23 +00:00
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
2015-11-29 19:04:40 +00:00
alias grbs='git rebase --skip'
2014-02-17 07:00:21 +00:00
alias grbi='git rebase -i'
2015-10-16 05:11:24 +00:00
alias grbm='git rebase master'
alias grbmi='git rebase master -i'
2014-02-17 07:00:21 +00:00
alias grbo='git fetch origin master && git rebase origin/master'
2015-10-16 05:11:24 +00:00
alias grboi='git fetch origin master && git rebase origin/master -i'
alias grbum='git fetch upstream master && git rebase upstream/master'
2013-07-07 21:30:11 +00:00
alias gre='git remote'
2014-09-30 00:51:23 +00:00
alias grea='git remote add'
2016-04-14 13:34:42 +00:00
alias gremo='git remote remove origin; git remote add origin'
2014-09-30 00:51:23 +00:00
alias greao='git remote add origin'
2013-09-25 22:54:37 +00:00
alias gref='git reflog'
2013-08-13 15:17:54 +00:00
alias grev='git remote -v'
2013-07-16 15:24:18 +00:00
alias grm='git rm'
2015-02-24 04:34:00 +00:00
alias grmr='git rm -r'
2016-04-14 13:34:42 +00:00
alias grp='git reset -p'
2013-07-07 21:30:11 +00:00
alias gsnapshot='git stash save "snapshot: $(date)" && git stash apply "stash@{0}"'
2014-03-07 20:00:19 +00:00
alias gsh='git show'
2018-03-15 18:39:50 +00:00
alias gshh='git show -w'
2013-07-07 21:30:11 +00:00
alias gs='git stash'
2016-04-14 13:34:42 +00:00
alias gsk='git stash -k -u'
alias gss='git stash save'
2013-07-07 21:30:11 +00:00
alias gsd='git stash drop'
2014-09-30 00:51:23 +00:00
alias gsdl='git stash drop stash@{0}'
2013-07-07 21:30:11 +00:00
alias gsl='git stash list'
2016-04-14 13:34:42 +00:00
alias gsi='git stash -p'
2013-07-07 21:30:11 +00:00
alias gsp='git stash pop'
2017-08-21 18:26:38 +00:00
alias gsp0='git stash pop stash@{0}'
alias gsp1='git stash pop stash@{1}'
alias gsp2='git stash pop stash@{2}'
alias gsp3='git stash pop stash@{3}'
alias gsp4='git stash pop stash@{4}'
alias gsp5='git stash pop stash@{6}'
alias gsp6='git stash pop stash@{7}'
2014-05-17 19:31:36 +00:00
alias gt='git tag'
alias gta='git tag -a'
alias gtd='git tag -d'
alias gtl='git tag -l'
2013-07-07 21:30:11 +00:00
alias gx='git reset --hard'
2015-11-04 19:25:27 +00:00
alias gxx='git reset --hard HEAD~1'
alias gstats='echo "Total commits: $(git rev-list HEAD --count)"; echo "\nAuthor breakdown:"; git shortlog | grep -E "^[^ ]"'
2015-10-16 05:11:24 +00:00
alias gwip="git add . && git commit -m \"WIP\""
2013-07-07 21:30:11 +00:00
2017-08-10 15:46:10 +00:00
# Haxe
alias flow='haxelib run flow'
alias snowfall='haxelib run snowfall'
# Other aliases
2017-04-25 16:01:18 +00:00
alias pal='vim ~/.private-dotfiles/aliases'
test -f ~/.private-dotfiles/aliases && . ~/.private-dotfiles/aliases
2017-06-12 11:23:58 +00:00
alias cmake-gen='cmake -D CMAKE_CXX_COMPILER="/Library/Developer/CommandLineTools/usr/bin/c++" CMAKE_C_COMPILER="/Library/Developer/CommandLineTools/usr/bin/cc" ..'