forked from pinktrink/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias
81 lines (59 loc) · 1.81 KB
/
alias
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
#!/usr/bin/env sh
# Just a nice little alias so I can open chrome with switches easily
alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
# Easy up to parent
alias ..='cd ..'
# ..x for going up x levels, up to 5
for i in {2..5}; do
alias "..$i"="cd $(printf "../%.0s" $(seq 1 $i))"
done
# Easily reinstall my IE VMs if the trial period ends
alias getievms='curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | env INSTALL_PATH="$IEVMS_INSTALL_PATH" IEVMS_VERSIONS="8 9 10 11" bash'
# View recently created processes
alias rp="watch -n 0 -t 'ps -u "'$USER | tail -n $(tput lines) | cut -c1-$(tput cols)'"'"
# Sublime Text 3 subl alias
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
# Easy alias for django-admin.py
alias dj='django-admin.py'
# Copy files to the pasteboard easily
alias pb='pbcopy < '
# Tools for opening files in different browsers
# Chrome
alias chr='open -a Google\ Chrome'
# Firefox
alias ffx='open -a Firefox'
# Safari
alias saf='open -a Safari'
# Opera
alias opr='open -a Opera'
# Fix tmux 256 colors
alias tmux='tmux -2'
# Keep the system alive and screen on.
alias stayup='caffeinate -dimsut 999999999999'
# Quick alias for git
alias g='git'
function build_git_aliases {
local al
local cm
while read -r line; do
al=$(echo $line | cut -d ' ' -f 1)
cm=$(echo $line | cut -d ' ' -f 2-)
if [[ ${cm:0:1} != '!' ]]; then
cm="git $cm"
else
cm=$(echo $cm | sed -E 's/^! *//')
fi
if ! which $al &> /dev/null; then
alias "g${al#alias.}"="$cm"
fi
done < <(git config --global --get-regexp '^alias\.')
}
build_git_aliases
function vim {
if [[ -z $@ ]]; then
$(which vim) .
else
$(which vim) $@
fi
}
alias vi='vim'