-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
71 lines (58 loc) · 2.03 KB
/
Copy pathbashrc
File metadata and controls
71 lines (58 loc) · 2.03 KB
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
shopt -s nocaseglob
set -o vi
#export VAR=value
#PS1='\[\e]0;\w\a]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ '
eval $(dircolors -b ~/.dir_colors)
# keep infinite command history
set HISTFILESIZE=-1
set HISTSIZE=-1
# add my home bin to the path for ease of dev
PATH=$PATH:~/bin
# make my life easier
alias vi='vim'
alias virc='vimr ~/.vimrc'
alias gpom='git push origin master'
alias github='cd ~/src/github.com/'
# make common commands more pleasant
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -lah'
alias cgrep='grep --color-always'
alias rscp='rsync -aP' # same thing as cp, but with a progress bar!
alias rsmv='rsync -aP --remove-source-files' # same thing as mv, but with a progress bar!
# dubious tmux miasma
alias tls='tmux ls'
alias tatt='tmux at -t'
alias tkill='tmux kill-ses -t'
# docker stuff that might get memorized some day
alias dstopall='docker stop $(docker ps -a -q)'
alias dockerrmall='docker rm -f $(docker ps -a -q)'
alias dockerrmiall='docker rmi -f $(docker images -q)'
alias dei='docker exec -it'
alias de='docker exec'
alias dps='docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}"'
alias dl='docker logs -f'
# pip is annoying aka the worst pip hack in history
alias pip='python -m pip'
# use tmux magic to auto build a nice session
DEVSESSIONNAME="dev"
REFSESSIONNAME="reference"
tmux has-session -t $DEVSESSIONNAME &>/dev/null
if [ $? != 0 ]
then
tmux new-session -s $DEVSESSIONNAME -d
tmux rename-window -t 0 "coding stuff"
tmux send-keys -t $DEVSESSIONNAME "github" C-m
tmux new-window -n "infrastructure stuff"
tmux send-keys -t $DEVSESSIONNAME "github" C-m
fi
tmux has-session -t $REFSESSIONNAME &>/dev/null
if [ $? != 0 ]
then
tmux new-session -s $REFSESSIONNAME -d
tmux rename-window -t 0 "cheatsheets"
tmux send-keys -t $REFSESSIONNAME "cat ~/tmuxcheatsheet " C-m
tmux split-window -t $REFSESSIONNAME -h
tmux send-keys -t $REFSESSIONNAME "cat ~/vimcheatsheet " C-m
fi