-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
125 lines (112 loc) · 3.52 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# shellcheck shell=bash
# shellcheck source=/dev/null
# Unix
alias c='clear; history 5'
alias cls='clear; ls -altr'
alias ht='history | tail -25'
alias hst='history | grep'
alias k9='killall -9'
alias ln='ln -v'
alias mkdir='mkdir -p'
alias cwd="pwd | tr -d '\n' | pbcopy && echo 'pwd copied to clipboard'"
alias less="less -RMN --ignore-case --status-column"
# ls
alias ll="ls -al"
alias la="ls -A -l -G"
alias l.='ls -d .[^.]*'
alias ll.='ls -ld .[^.]*'
alias l='ls -lhGt' # -l long listing, most recent first with color
alias lh="ls -lh"
alias lt='ls -lt' # sort with recently modified first
# cd
alias cdc='cd ~/code'
alias cdd='cd ~/code/dotfiles'
alias s='cd ..'
# Grep
alias gr="grep --color=always -i" # use colors; change to auto if causing problems
alias grr="grep -r --color=always -i" # use colors; change to auto if causing problems
alias grep="grep --color=always -i" # use colors; change to auto if causing problems
alias egrep="egrep --color=always -i"
alias ge="egrep --color=always -i"
alias gee="egrep -r --color=always -i"
alias gal="alias | grep"
# Process Management
alias pgrep='pgrep -fil'
alias pg='pgrep -fil'
alias tou='top -o cpu' # cpu
alias tom='top -o vsize' # memory
# Tmux
alias tma="tmux attach -t"
alias tmm="tmux attach || tmux"
alias tmn="tmux new -s"
alias tml="tmux ls"
alias tmi="tmux info"
alias tmk="tmux kill-session -t"
# Git
alias ga='git add'
alias gaa='git add -A'
alias gb='git branch -v'
alias gbb='git branch -vv'
alias gbr='git branch -r'
alias gc='git commit'
alias gca='git commit -a'
alias gcm='git commit -m'
alias gco='git checkout'
alias gd='git diff'
alias gds='git diff --stat'
alias gdt='git difftool'
alias gexport='git archive --format zip --output'
alias gl="git log"
alias gll="git log --oneline --decorate"
alias glg='git log --oneline --graph --decorate --all'
alias gmt="git mergetool"
alias gpl='git pull'
alias gpu='git push'
alias grm='git remote -v'
alias gs='git status --short'
alias gss='git status'
alias gls='clear; gss'
# Rails
alias tdl='tail -f log/development.log'
alias ttl='tail -f log/test.log'
alias rc='bin/rails console'
alias rd='bin/rails dbconsole'
alias rr='bin/rails routes'
alias rs='bin/rails server'
alias rt='bin/rails test'
alias migrate='bin/rails db:migrate'
# Ruby
alias ri='ri -f ansi'
# Utility
alias reload='source ~/.zshrc; source ~/.zshenv && echo Reloaded ~/.zshrc and ~/.zshenv'
alias path='echo $PATH | tr -s ":" "\n"' # pretty print the path
# Editor
alias vi="$EDITOR"
alias vim="$EDITOR"
alias e="$EDITOR"
alias ee="$EDITOR ."
alias eg="$EDITOR ~/.gitconfig"
alias ea="$EDITOR ~/.aliases.local && reload"
alias ev="$EDITOR ~/.vim/vimrc.local && reload"
alias et="$EDITOR ~/.tmux.conf.local && reload"
alias v="$VISUAL"
alias vv="$VISUAL ."
# Postgres
alias pgon="pg_ctl start -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log"
alias pgoff="pg_ctl stop -D /usr/local/var/postgres -s -m fast"
alias pgrestart="pg_ctl restart -D /usr/local/var/postgres -s -m fast -l /usr/local/var/postgres/server.log"
alias pgstatus="pg_ctl status -D /usr/local/var/postgres"
alias pgst="pg_ctl status -D /usr/local/var/postgres"
# Vagrant
alias vh='vagrant halt'
alias vs='vagrant suspend'
alias vup='vagrant up'
# Apps
alias h='heroku'
alias hl='heroku local -f Procfile.dev'
alias fs='foreman start'
alias fgs='forego start'
alias marked="open -a Marked\ 2"
alias o='open . &'
# Include custom aliases
[[ -f ~/.aliases.local ]] && source ~/.aliases.local