-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
132 lines (111 loc) · 3.16 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/sbin:/Users/edwardromano/bin:/sbin:/Users/edwardromano/bin"
export PATH
mkdir -p ~/.zsh/cache
#Source all of our zsh files
export ZSH=~/.dotfiles/zsh
typeset -U config_files
config_files=($ZSH/*.zsh)
export PLATFORM=`uname -s`
# Load all additional files
for file in $config_files
do
source $file
done
# languages
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_CTYPE=C
# completion
autoload -U compinit; compinit
_fab_list() {
reply=(`fab --shortlist`)
}
compctl -K _fab_list fab
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # match uppercase from lowercase
# viewing / editing
export PAGER='less'
export EDITOR='vim'
export MUTT_EDITOR='vim'
autoload colors; colors # ANSI color codes
# So terminals can have base16_tomorrow-night
BASE16_SHELL="$HOME/.config/base16-shell/"
[ -n "$PS1" ] && \
[ -s "$BASE16_SHELL/profile_helper.sh" ] && \
eval "$("$BASE16_SHELL/profile_helper.sh")"
# history
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_DUPS
export HISTSIZE=10000
export SAVEHIST=10000
export HISTFILE=$HOME/.zsh/history
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
# prompt
_git_prompt () {
test -z "$(pwd | egrep '/\.git(/|$)')" || return
local _git_branch="`git branch 2>/dev/null | egrep '^\*' | sed 's/^\* //'`"
test -z "$_git_branch" && return
local _git_status=`git status --porcelain | sort | awk '
BEGIN { modified = 0; staged = 0; new = 0; }
/^ / { modified += 1 }
/^[^\? ]/ { staged += 1 }
/^\?/ { new += 1 }
END {
if (staged) { print "∆"; exit }
if (modified) { print "∂"; exit }
if (new) { print "≈"; exit }
}'`
if [[ -n $_git_status ]]; then
_git_status=":%F{yellow}$_git_status%f]"
else
_git_status="] "
fi
echo -n "[%F{gray}±%f:%F{blue}$_git_branch%f$_git_status"
}
export PROMPT='
%(?..[%{$fg[red]%}%?%{$reset_color%}] )%{$fg[magenta]%}%m%{$reset_color%}: %{$fg[cyan]%}%~
%{$fg[yellow]%}$%{$reset_color%} '
if which git >/dev/null 2>&1; then
RPROMPT='$(_git_prompt)'
fi
setopt PROMPT_SUBST # perform substitution/expansion in prompts
# python
if [ -f ~/.pythonrc ]; then
export PYTHONSTARTUP=~/.pythonrc
fi
# ruby
RBENV_DIR="$HOME/.rbenv"
if [ -d "$RBENV_DIR" ]; then
export PATH="$RBENV_DIR/bin:$PATH"
if command -v rbenv > /dev/null; then
eval "$(rbenv init -)"
fi
fi
# nvm - node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# npm
# NPM_PACKAGES_DIR="$HOME/.npm-packages"
# if [ -d "$NPM_PACKAGES_DIR" ]; then
# export PATH="$PATH:$NPM_PACKAGES_DIR/bin"
# fi
# user-dependent settings
# if [[ "`id -u`" -eq 0 ]]; then
# umask 022
# else
# umask 077
# fi
# local settings
if [ -f ~/.zshrc.local ]; then
. ~/.zshrc.local
fi
# export VAGRANT_DEFAULT_PROVIDER=vmware_fusion
# JAVA
export JAVA_HOME=$(/usr/libexec/java_home)
alias blender=/Applications/blender.app/Contents/MacOS/blender
alias new-tmux=~/.dotfiles/new-tmux.sh