-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
152 lines (127 loc) · 4.99 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env sh
# CLI aliases (bash and zsh).
# echo ~/.aliases
# Interactive operation...
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias md='mkdir -p'
# Handy shortcuts
alias untar='tar zxvf'
alias unbz='tar jxvf'
alias trash="mv $1 ~/.Trash"
alias del="trash"
alias whence='type -a' # An improved `where`.
alias hide="SetFile -a V" # Hide files from Finder (Mac only)
alias show="SetFile -a v" # Unhide files from Finder (Mac only)
alias alert='(savestatus=$?; ~/.local/bin/alert $savestatus "$@"; exit $savestatus)'
alias notify='alert'
alias brb='alert'
# Remove those crazy .DS_Store files recursively
alias rmds='find . -name .DS_Store -type f -ls -delete'
# When `wget` is not installed...
# It's better to just `brew install wget`.
# alias wget='curl -O'
# Some shortcuts for different directory listings
alias ls='ls -GFh --color --group-directories-first' # classify files in colour
alias l='ls -GFh1 --color --group-directories-first' #
alias ll='ls -GlFh --color --group-directories-first' # long list
alias lll='ls -GAlF --color --group-directories-first' # long list including hidden files
alias la='lll' # all but . and ..
alias lla='lll' #
alias dir='lll'
alias vdir='ls'
alias list='l'
# Colorized and human readable defaults
alias grep='grep --color' # Highlight the found results.
alias df='df -h' # Human readable file system stats
alias du='du -h' #
# Improved recursive find with grep, exclude common big nasty files.
alias gf='find . -path "*/.git/*" -o -path "*/node_modules/*" -o -name "*.sql" -o -name "*.mysql" -o -name "*.sublime-*" -o -name "*.min.*" -o -name "*.log" -prune -o -type f -print0 | xargs -0 grep -I -n'
# Find big files
alias b="du -k -d 1 * | sort -nr | cut -f2 | xargs du -sh"
alias bb="du -k * | sort -nr | cut -f2 | xargs du -sh"
# File size
alias fs="stat -f \"%z bytes\""
# Processes
alias tu='ps aux | sort -n +2 | tail -10' # top 10 cpu processes
alias tm='ps aux | sort -n +3 | tail -10' # top 10 memory processes
# What's blocking a volume from being ejected?
alias blocking='lsof +fg +D /Volumes/$1 | grep -v EVO'
# Miscellaneous preferences
alias diff='diff -u' # default to unified diff format
alias less='less -r' # raw control characters
# Web Developer shortcuts
alias hosts='sudo -i $EDITOR /etc/hosts'
alias h='hosts'
alias myip='curl icanhazip.com'
alias ipinfo='curl ipinfo.io'
# git shortcuts
alias t='git tree --all'
alias g='git status .'
alias gg='git status'
alias gt='git tree'
alias gta='git tree --all'
alias gtd='git tag -d'
alias gtD='git tag -d'
alias gfa='git fetch --all --prune --prune-tags'
alias gpa='git pull --all --prune'
alias gd='git diff'
alias gl='git log --graph --oneline --all --decorate'
alias gk='git log --color --format="format:%C(auto)%h %Cred%<(8,trunc)%aN %Cblue%<(12)%ar %Creset%s"'
# Add all unstaged files in the current directory and below.
alias .ga='git status -s . | grep "^??" | cut -c4- | while read f; do git add "$f"; done'
# Delete any missing files from git.
alias .gd='git status -s . | grep "^!!" | cut -c4- | while read f; do git delete "$f"; done'
# Remove all unstaged files in the current directory and below (the inverse of .ga)
alias .gr='git status -s . | grep "^??" | cut -c4- | while read f; do rm -f "$f"; done'
# Undo mode changes (755 <-> 644).
alias .gm="git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs chmod +x && git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs chmod -x"
alias gpap='git pull --all --prune'
alias gfap='git fetch --all --prune'
alias grr='git remote remove'
# Docker
alias dp='docker ps'
alias dpa='docker ps -a'
# Homebrew
alias brew_update="brew -v update; brew upgrade --force-bottle; brew cleanup; brew prune; brew doctor;"
# Photoshop & Illustrator
alias psp='open -b com.adobe.Photoshop'
alias ai='open -b com.adobe.Illustrator'
# Python
alias py='python3'
alias pip='pip3'
# ImageOptim
alias opt='open -a ImageOptim'
alias mangle='open -a "Name Mangler 3"'
alias alf='open -a ImageAlpha'
# Use macvim, if installed.
if [[ -r mvim ]]
then
alias vim='mvim -v'
fi
# Ddev
alias ddd="ddev describe"
alias ddr="ddev exec drush"
alias ddra="ddev drall exec drush"
alias ddc="ddev composer"
alias dds="ddev sequelace"
alias ddl="ddev launch" # website
alias ddp="ddev launch -p" # phpmyadmin
alias ddm="ddev launch -m" # mailhog
alias ddcod="ddev composer outdated 'drupal/*'"
# Platform.sh
alias p='platform'
alias psh='p env:ssh'
alias prd='p var:set --no-wait redeploy "$(date)"'
# Pantheon Terminus
alias terminus="$HOME/.terminus/terminus"
# Jira
alias j='jira'
alias jt='jira tempo'
alias jm='jira mine'
alias jr='jira reported'
alias jd='jira dashboard'
alias jb='jira branch'
alias ja='jira assigned'
alias jc='jira new'