forked from thoughtbot/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
68 lines (51 loc) · 1.35 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
# load our own completion functions
fpath=(~/.zsh/completion $fpath)
# completion
autoload -U compinit
compinit
for function in ~/.zsh/functions/*; do
source $function
done
# automatically enter directories without cd
setopt auto_cd
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# expand functions in the prompt
setopt prompt_subst
# prompt
export PS1='[${SSH_CONNECTION+"%n@%m:"}%~] '
# ignore duplicate history entries
setopt histignoredups
# keep TONS of history
export HISTSIZE=4096
# automatically pushd
setopt auto_pushd
export DIRSTACKSIZE=10
# awesome cd movements from zshkit
setopt AUTOCD
setopt AUTOPUSHD PUSHDMINUS PUSHDSILENT PUSHDTOHOME
setopt cdablevars
# Enable extended globbing
setopt EXTENDED_GLOB
# Use nvm
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
# Add path to the front of PATH, removing its previous occurrence if necessary
pathadd() {
if [ -d "$1" ]; then
local P=`echo $1 | sed 's_/_\\\/_g'`
PATH=$1:`echo $PATH | awk -v RS=: -v ORS=: "/$P/ {next} {print}" | sed 's/:$//'`
fi
}
# Put /usr/local/bin ahead of /usr/bin
pathadd /usr/local/bin
# Use rbenv
pathadd $HOME/.rbenv/bin
pathadd $HOME/.rbenv/shims
eval "$(rbenv init -)"
# Add Haskell binaries to PATH
pathadd $HOME/Library/Haskell/bin
pathadd $HOME/.cabal/bin
# Add the Heroku Toolbelt to PATH
pathadd /usr/local/heroku/bin