forked from hashrocket/dotmatrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
148 lines (125 loc) · 4.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
fpath=(
$fpath
~/.rvm/scripts/zsh/Completion
~/.zsh/functions
/usr/local/share/zsh/site-functions
)
# Theme
ZSH_THEME="robbyrussell"
# ZStyle
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
zstyle ':completion:*:ssh:*' tag-order hosts users
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zshcache
# Autoload
autoload colors; colors
autoload -U compinit; compinit
autoload edit-command-line
zle -N edit-command-line
# Keybinds
bindkey -e
bindkey '^x^e' edit-command-line
bindkey '\ep' up-line-or-search
bindkey '\en' down-line-or-search
bindkey '\ew' kill-region
if [ -z "$TMUX" ]; then
fg-widget() {
stty icanon echo pendin -inlcr < /dev/tty
stty discard '^O' dsusp '^Y' lnext '^V' quit '^\' susp '^Z' < /dev/tty
zle reset-prompt
if jobs %- >/dev/null 2>&1; then
fg %-
else
fg
fi
}
zle -N fg-widget
bindkey -M emacs "^Z" fg-widget
bindkey -M vicmd "^Z" fg-widget
bindkey -M viins "^Z" fg-widget
fi
# Options
setopt appendhistory
setopt extendedglob
setopt histignoredups
setopt nonomatch
setopt prompt_subst
setopt interactivecomments
setopt autoparamslash
setopt autopushd
setopt correct
setopt correctall
setopt autocd
# History
HISTFILE=~/.zsh_history
HISTSIZE=5000
SAVEHIST=10000
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
# Plugins
plugins=(rails git ruby bundler vi-mode)
# Functions
l.() {
ls -ld "${1:-$PWD}"/.[^.]*
}
emacs.() {
emacsclient -c -a= $*
}
# default apps
(( ${+PAGER} )) || export PAGER='less'
(( ${+EDITOR} )) || export EDITOR='vim'
export PSQL_EDITOR='vim'
# Aliases
# * Additional aliases are found in `.sharedrc`
#
alias reload='source ~/.zshrc; echo -e "\n\u2699 \e[33mZSH config reloaded\e[0m \u2699"'
cuke() {
local file="$1"
shift
cucumber "features/$(basename $file)" $@
}
compctl -g '*.feature' -W features cuke
# Import
zrcl="$HOME/.zshrc.local"
[[ ! -a $zrcl ]] || source $zrcl
# Misc
cdpath=(~ ~/src $DEV_DIR $SOURCE_DIR)
typeset -aU path
# Sources
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOME/.sharedrc
source $HOME/.zsh/aliases
source $HOME/.zsh/exports
source $HOME/.zsh/functions
source $HOME/.zsh/function.sh
source $HOME/.zsh/key-binding.zsh
source $ZSH/oh-my-zsh.sh # Oh-My-ZSH
# External
if which swiftenv > /dev/null; then eval "$(swiftenv init -)"; fi # SwiftEnv
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # NVM
eval `docker-machine env 2>/dev/null` # Docker
eval "$(pyenv init -)" # Pyenv
eval "$(pyenv virtualenv-init -)" #Pyenv VirtualEnv
if [[ -s "$HOME/.asdf/asdf.sh" ]] ; then source "$HOME/.asdf/asdf.sh" ; fi # ASDF
if [[ -s "$HOME/.asdf/asdf.bash" ]] ; then source "$HOE/asdf/asdf.bash" ; fi # ASDF
if [[ -s "$HOME/.asdf/completions/asdf.sh" ]] ; then source "$HOME/.asdf/completions/asdf.sh" ; fi # ASDF
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi # RVM
if [[ "$OSTYPE" == "linux-gnu" ]]; then
xcape -e 'Caps_Lock=Escape'
fi
# Z
. $HOME/.zsh/z/z.sh
command -v brew > /dev/null && [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /Users/bshega/.nvm/versions/node/v9.8.0/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /Users/bshega/.nvm/versions/node/v9.8.0/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /Users/bshega/.nvm/versions/node/v9.8.0/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /Users/bshega/.nvm/versions/node/v9.8.0/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh
# FZF
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh