-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
98 lines (79 loc) · 1.86 KB
/
zshrc
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="fishy"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(screen git zsh-syntax-highlighting)
# Comment this out to disable weekly auto-update checks
DISABLE_AUTO_UPDATE="true"
source $ZSH/oh-my-zsh.sh
## ZSH Options
setopt menu_complete
unsetopt correct_all
## Determine System
if [ `uname -s` = 'Darwin' ]; then
SYSTEM='MAC'
else
SYSTEM='LINUX'
fi
if [[ "$TERM" != 'screen-256color' ]]; then
export TERM='xterm-256color'
fi
## Variables
export EDITOR='vim'
export LESS='-I -R'
## Shell Functions
function _tm() {
if [[ -z "$1" ]]; then
SESSION="${PWD:t:gs/./-/}"
else
SESSION="$1"
fi
tmux new -A -s "$SESSION"
}
## Aliases
# General
alias pd='pushd'
alias v='vim'
alias tm=_tm
# Golang
alias gf='gofmt -w .'
# Git
alias g='git'
alias l='git log'
alias m='git co master'
alias p='g pr'
alias lm='git log master'
alias st='git st'
alias br='git br'
alias co='git co'
alias di='git di'
alias dc='git dc'
alias ci='git ci'
alias add='git add'
alias brv='git br -vv'
alias amend='git commit --amend --no-edit'
alias cr='git push -u origin head'
# Mac
if [ "$SYSTEM" != 'MAC' ]; then
alias ls='ls --color'
alias R='R --vanilla --silent'
# golang
export GOPATH="${HOME}/go"
export PATH="${GOPATH}/bin:${PATH}"
else
# System is a Mac
# Prefer Homebrew binaries to system
export PATH="/usr/local/bin:$PATH"
# Enable CLI Colouring
export CLICOLOR=1
fi
# Moooo
if [[ -o login ]]; then
(fortune -s | cowsay | lolcat) 2>/dev/null
fi