-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzsh_aliases
62 lines (55 loc) · 1.88 KB
/
zsh_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
# Fix hub alias
if (( $+commands[hub] )) ; then
unalias git
function git() { hub $@; }
fi
# Git
alias gclean='git reset --hard && git clean -df'
alias gha='git hist --all'
alias ghb='git hist --branches'
alias ghf='git hist --first-parent'
alias mux='tmuxinator'
if (( $+commands[delta] )) ; then
alias diff="delta"
fi
if (( $+commands[bat] )) ; then
alias cat="bat"
fi
if (( $+commands[batcat] )) ; then
alias cat="batcat"
fi
if (( $+commands[thefuck] )) ; then
eval "$(thefuck --alias)"
fi
alias myip="curl http://ifconfig.me/ip"
alias webserver="python -m http.server"
alias tor="docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --device /dev/snd --name tor-browser jess/tor-browser"
alias docker-compose='GIT_BRANCH=`git rev-parse --abbrev-ref HEAD | tr "[:upper:]" "[:lower:]" | tr -cd "[:lower:]"` docker-compose'
alias view='vim -R'
alias lc="colorls --sort-dirs"
alias ll="colorls --sort-dirs --git-status -l"
alias dco="docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.osx.yml"
# Backward search with patterns
bindkey '^r' history-incremental-pattern-search-backward
# Colorful man
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
# Use neovim for vi
if (( $+commands[nvim] )); then
alias vi=nvim
alias vim=nvim
fi
# Papertrail log viewing with lnav
function pt() { papertrail -f -d 5 $* | lnav; }
# Useful to notify long-running scripts have terminated
alias alarm='ogg123 -q /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga'
alias bing='ogg123 -q /usr/share/sounds/freedesktop/stereo/complete.oga'