-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliasrc
75 lines (69 loc) · 1.87 KB
/
aliasrc
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
# ls improvements
alias ls='ls --color=auto'
alias ll='ls -lA'
# git
alias g='git'
gs() {
if [ $# -eq 0 ]; then
git status
else
git show $@
fi
}
_gs() {
(( CURRENT++ ))
words[1]=(git show)
_normal
}
compdef _gs gs
alias ga='git add'
alias gaa='git add --all'
alias gc='git commit --verbose'
alias gcm='git commit --message'
alias gcam='git commit --all --message'
alias gcf='git commit --amend --no-edit'
alias gcl='git clone'
alias gb='git branch'
alias gba='git branch --all'
alias gd='git diff'
alias gds='git diff --staged'
alias gch='git checkout'
alias gchm='git checkout master'
alias gchb='git checkout -b'
alias gl='git log --decorate'
alias glg='git log --decorate --graph'
alias glo='git log --decorate --graph --oneline'
alias gld='git log --decorate --graph --patch' # Show diff. 'gld' = 'git log diff'
alias gp='git push'
alias gpo='git push origin'
alias gpom='git push origin master'
alias gplm='git pull'
alias gplr='git pull --rebase'
alias gri='git rebase -i'
# always use protection
alias del='trash-put'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -I'
# fasd utils
alias v='f -e vim'
alias m='f -e mpv'
alias o='a -e xdg-open'
# fzf shortcuts
alias fv='vim "$(fzf)"'
alias fo='xdg-open "$(fzf)"'
alias fm='mpv "$(fzf)"'
# cleaning up our $HOME
alias mitmproxy="mitmproxy --set confdir=${XDG_CONFIG_HOME:-$HOME/.config}/mitmproxy"
alias mitmdump="mitmdump --set confdir=${XDG_CONFIG_HOME:-$HOME/.config}/mitmproxy"
alias mitmweb="mitmweb --set confdir=${XDG_CONFIG_HOME:-$HOME/.config}/mitmproxy"
# misc
alias epoch='date +%s'
alias vi='vim'
mkd() { mkdir -p "$1" && cd "$1" }
bak() { cp -ri -- "$1" "$1.bak" }
alias cmusync="tail -f -n 1 ~/.config/cmus/cmusync 2> /dev/null"
alias py='python'
spec() { sxiv =(sox "$1" -n spectrogram -o -) }
alias waitpid='tail -f /dev/null --pid'
sleepto() { sleep $(( $(date -d "$*" +%s) - $(date +%s) )) }