-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
77 lines (71 loc) · 2.75 KB
/
aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/zsh
alias l='ls -1'
alias ll='ls -lahG'
alias lt='ls -lahGt | head'
alias lta='ls -lahGt'
# Git
alias g='git'
alias gb='git br'
alias gf='git fetch --all'
alias gu='git pull --prune'
alias gp='git push'
alias gpf='git push --force-with-lease'
alias gpp='gu && gp'
alias gph='gp && ob'
alias ghb='gh browse'
alias gfod='gf && g rebase origin/dev'
alias gfom='gf && g rebase origin/master'
alias gphm='git push heroku main'
alias grm='git rm $(git ls-files --deleted)'
alias gs='git status -sb'
alias gst='git st'
alias gr='git remote -v'
alias gl='git l'
alias glg='git lg'
alias glgh='git lg --committer=GitHub'
alias gw="git show"
alias gw^="git show HEAD^"
alias gw^^="git show HEAD^^"
alias gd='git diff -b'
alias gdc='git diff --cached'
alias gdt='git difftool'
alias ga='git add'
alias gap='git add --intent-to-add . && git add -p' # Like "git add -p" but also ask about any newly added files.
alias gm='git merge'
alias ge='git-edit-new'
alias gpr='hub pull-request'
alias groot="cd \$(git rev-parse --show-toplevel)"
alias vi='vim -u NONE -N' # plain vim with no vimrc, but not vi compatible
alias tm='tmux -u attach || tmux -u new'
alias less='less -R '
alias ..='cd ..'
alias q='exit'
function grp() { grep -rn --exclude=\*.swp --exclude=\*.log --exclude=tags --exclude=gems.tags --exclude-dir=.git --exclude-dir=tmp $1 . 2>/dev/null }
function greps() { grep -rn --exclude=\*.swp --exclude=\*.log --exclude=tags --exclude=gems.tags --exclude-dir=.git --exclude-dir=tmp $1 . 2>/dev/null | sed -E 's/[[:space:]]+//' | grep $1 }
alias largefiles='find . -ls | sort -n -k 7 | tail -n 20'
# Dev
alias ttr='mkdir -p tmp && touch tmp/restart.txt'
alias rttr='rm tmp/pids/server.pid && ttr'
alias bi='bundle install'
alias bu='bundle update'
alias bout='bundle outdated'
alias bo='bundle open'
alias be='bundle exec'
alias pt='heroku addons:open papertrail'
alias drb='docker run -it --rm -v "$(pwd)":/workspace -w /workspace ruby:latest /bin/bash'
alias dirb='docker run -it --rm -v "$(pwd)":/workspace -w /workspace ruby:latest irb'
alias ctagsr='ctags --languages=-javascript -R'
alias k=kubectl
alias opa='eval $(op signin my)' # 1Password
alias jc=journalctl
alias sc=systemctl
# macOS
if [[ `uname -s` == 'Darwin' ]]; then
alias rmdsstores="find . -name '*.DS_Store' -type f -delete"
alias bs='brew services'
alias brewupd="brew update && echo \"$fg[blue]==>$reset_color Outdated\" && brew outdated"
alias brewupg="brew upgrade && brew cleanup"
alias js="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Helpers/jsc"
alias updates='softwareupdate -l && echo "==> Now checking MAS apps updates" && mas outdated && echo "==>" && brew update && echo "==>" && brew outdated && echo "==>" && brew cask outdated'
alias mvim='/Applications/MacVim.app/Contents/bin/mvim'
fi