-
Notifications
You must be signed in to change notification settings - Fork 2
/
aliases
67 lines (53 loc) · 1.61 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
#!/usr/bin/env bash
# Detect which `ls` flavor is in use
unamestr=$(uname)
if [[ $unamestr == 'Darwin' ]]; then
colorflag="-G"
else
colorflag="--color=auto"
fi
alias py="ptpython"
alias pyi="ptipython"
alias nv="nvim"
if command -v lsd >/dev/null 2>/dev/null; then
alias ls='command lsd'
colorflag=""
else
alias ls="command ls ${colorflag}"
fi
alias l="ls -lf ${colorflag}"
alias la="ls -laF ${colorflag}"
alias ll="ls -lh ${colorflag}"
# It's extremely annoying that this is not the default
alias rg="command rg --hidden"
# Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias gitlog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias vup="vagrant destroy -f && vagrant up && vagrant ssh"
alias vdown="vagrant destroy -f"
alias gst="git status"
alias gd="git diff"
alias gco="git checkout"
alias gfa="git fetch --all"
alias ga="git add"
alias gc="git commit -v"
alias gp="git push"
vagrant-kill-all() {
for i in $(vagrant global-status | grep virtualbox | awk '{ print $1 }'); do
vagrant destroy -f "$i"
done
}
add-upstream-remote() {
git remote add upstream "[email protected]:$1"
}
working() {
# Drop myself into a running tmux session called working
# TODO: Add a local setup script in order to initialize local vars
# Note to self: -d is a good flag since it allows for aggresive resizing
if ! tmux a -d -t working >/dev/null 2>/dev/null; then
tmux new -s working
fi
}