-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathzshrc
149 lines (113 loc) · 3.63 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# load our own completion functions
fpath=(~/.zsh/completion $fpath)
# completion
autoload -U compinit
compinit
# automatically enter directories without cd
setopt auto_cd
# use vim as an editor
export EDITOR=vim
export VISUAL=vim
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# project aliases
if [ -e "$HOME/.project_aliases" ]; then
source "$HOME/.project_aliases"
fi
# vi mode
bindkey -v
bindkey "^F" vi-cmd-mode
bindkey jj vi-cmd-mode
# use incremental search
bindkey "^R" history-incremental-search-backward
# add some readline keys back
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
# handy keybindings
bindkey "^P" history-search-backward
bindkey "^Y" accept-and-hold
bindkey "^N" insert-last-word
bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy"
# keep more history in a .zhistory file
export HISTSIZE=1000
export HISTFILE=~/.zhistory
# ignore duplicate history entries
setopt hist_ignore_all_dups
# add to the history incrementally, not just when the shell exits
setopt inc_append_history
# look for ey config in project dirs
export EYRC=./.eyrc
# automatically pushd
setopt auto_pushd
export dirstacksize=5
# set localhost for postgres
export PGHOST=localhost
# recommended by brew doctor
export PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/usr/texbin:~/bin'
# Enable zmv, alias to 'mmv' to allow matching like `mmv *.mp3 *.old.mp3`
autoload -U zmv
alias mmv='noglob zmv -W'
# Fancy bundler - checks for existing gems and installs in parallel
function b {
if [[ $# == 0 ]]
then
bundle check || bundle install && bundle --binstubs=./bin/stubs
else
bundle "$@"
fi
}
# Just type `cd <DIRECTORY_UNDER_ONE_OF_THESE_DIRS>` to go there, without
# the full path. Autocomplete and everything! /ht @gabebw
cdpath=($HOME $HOME/dev $HOME/devel $HOME/dev/fastly $HOME/dev/personal)
# You can hit C-X to open your $EDITOR
# with the command typed in the buffer
autoload edit-command-line
zle -N edit-command-line
bindkey '^X' edit-command-line
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
# load thoughtbot/dotfiles scripts
export PATH="$HOME/.bin:$PATH"
# mkdir .git/safe in the root of repositories you trust
export PATH=".git/safe/../../bin:$PATH"
# Paths for Postgres.app binaries
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
# unset RBENV_VERSION
# load rbenv if available
if which rbenv &>/dev/null ; then
export PATH="$HOME/.rbenv/bin:$PATH"
fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Jump stuff
if which jump &>/dev/null ; then
source `jump-bin --zsh-integration`
fi
# enable colored output from ls, etc
export CLICOLOR=1
# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
# Source everything in the zsh directory
BASE="$HOME/.zsh"
for file in "$BASE"/*.zsh; do
source "$file"
done
# Add zsh-syntax-highlighting
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Load directory-specific shell config (https://direnv.net/)
eval "$(direnv hook zsh)"
# Note that these FZF options are used by fzf.vim automatically! Yay!
# Use a separate tool to smartly ignore files
export FZF_DEFAULT_COMMAND='rg --hidden --files --ignore-file ~/.ignore'
# Jellybeans theme: https://github.com/junegunn/fzf/wiki/Color-schemes
export FZF_DEFAULT_OPTS='--color fg:188,bg:233,hl:103,fg+:222,bg+:234,hl+:104
--color info:183,prompt:110,spinner:107,pointer:167,marker:215
--bind j:page-up,k:page-down
--reverse --tac
'
export PATH="/usr/local/sbin:$PATH"
# Disable Spring on all Rails apps
export DISABLE_SPRING=true