-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases.zsh
72 lines (60 loc) · 2.19 KB
/
aliases.zsh
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
alias networkwho='sudo lsof -i -P | egrep -i "listen|established"'
alias ip_please='echo -n "local: " && ifconfig | grep -i "inet " | cut -d " " -f 2 | tail -n 1 && echo -n "extern: " && curl http://www.icanhazip.com'
alias showHiddenFiles='defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder'
alias hideHiddenFiles='defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder'
alias unload_ftdi='sudo kextunload -b com.apple.driver.AppleUSBFTDI'
alias load_ftdi='sudo kextload -b com.apple.driver.AppleUSBFTDI'
alias devdevs='ls /dev/tty.*'
alias pyterm='python2.7 ~/code/RIOT/RIOT/dist/tools/pyterm/pyterm -p $PORT'
alias g='git'
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
# List direcory contents
alias ls='ls $colorflag'
alias lsa='ls -lah $colorflag'
alias l='ls -la $colorflag'
alias ll='ls -l $colorflag'
alias la='ls -lA $colorflag'
# Basic directory operations
alias ...='cd ../..'
alias ..='cd ..'
alias md='mkdir -p'
# file operations
alias cp='cp -i'
alias rcp='rsync -v --progress'
alias rmv='rsync -v --progress --remove-source-files'
alias mv='mv -iv'
alias rm='rm -iv'
alias rmdir='rmdir'
alias ln='ln -v'
alias chmod="chmod"
alias chown="chown"
alias grep='grep --colour=auto'
alias egrep='egrep --colour=auto'
# git shortcuts
alias gst='git status'
alias gdi='git diff'
# Enable aliases to be sudo’ed
alias sudo='sudo '
# Gzip-enabled `curl`
alias gurl='curl --compressed'
# OS X has no `md5sum`, so use `md5` as a fallback
command -v md5sum > /dev/null || alias md5sum="md5"
# OS X has no `sha1sum`, so use `shasum` as a fallback
command -v sha1sum > /dev/null || alias sha1sum="shasum"
# Ring the terminal bell, and put a badge on Terminal.app’s Dock icon
# (useful when executing time-consuming commands)
alias badge="tput bel"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# misc.
alias now='date'
# freeBSD specifics
if [[ `uname` == "FreeBSD" ]]; then
alias setup_tmux='source ~/dotfiles/tmux/setup_stats_session.zsh'
alias stats='setup_tmux; tmux attach -t stats'
fi