-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
176 lines (141 loc) · 5.25 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
source ~/.zplug/init.zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/git-flow", from:oh-my-zsh
zplug "plugins/jsontools", from:oh-my-zsh
zplug "plugins/python", from:oh-my-zsh
zplug "plugins/pip", from:oh-my-zsh
zplug "plugins/screen", from:oh-my-zsh
zplug "plugins/wd", from:oh-my-zsh
zplug "plugins/ls-colors", from:oh-my-zsh
zplug "plugins/symfony2", from:oh-my-zsh
zplug "plugins/systemd", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/docker-compose", from:oh-my-zsh
zplug "plugins/history", from:oh-my-zsh
zplug "plugins/composer", from:oh-my-zsh, defer:2
zplug "plugins/laravel5", from:oh-my-zsh
zplug "buonomo/yarn-completion", defer:2
zplug "plugins/ng", from:oh-my-zsh
#antigen bundle flogib-aliases
#antigen bundle ifs
# Syntax highlighting bundle.
zplug zsh-users/zsh-syntax-highlighting, defer:2
zplug zsh-users/zsh-history-substring-search, defer:3
# Load the theme.
# zplug "fgibaux/bef829ad67f2a37c30fbba07e53c54c4", from:gist, as:theme
zplug denysdovhan/spaceship-prompt, use:spaceship.zsh, from:github, as:theme
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
##############################################################################
# zsh configuration
##############################################################################
# History Configuration
#######################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
#setopt append_history #Append history to the history file (no overwriting)
setopt share_history #Share history across terminals
#setopt inc_append_history #Immediately append to the history file, not just when a term is killed
setopt hist_ignore_dups
setopt HIST_FIND_NO_DUPS
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
# Completion configuration
##########################
# zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# case-insensitive matching only if there are no case-sensitive
#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' menu select
# Keys configuration
####################
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
zmodload zsh/terminfo
typeset -gA key_info
key_info=(
'Control' '\C-'
'Escape' '\e'
'Meta' '\M-'
'Backspace' "^?"
'Delete' "^[[3~"
'F1' "$terminfo[kf1]"
'F2' "$terminfo[kf2]"
'F3' "$terminfo[kf3]"
'F4' "$terminfo[kf4]"
'F5' "$terminfo[kf5]"
'F6' "$terminfo[kf6]"
'F7' "$terminfo[kf7]"
'F8' "$terminfo[kf8]"
'F9' "$terminfo[kf9]"
'F10' "$terminfo[kf10]"
'F11' "$terminfo[kf11]"
'F12' "$terminfo[kf12]"
'Insert' "$terminfo[kich1]"
'Home' "$terminfo[khome]"
'PageUp' "$terminfo[kpp]"
'End' "$terminfo[kend]"
'PageDown' "$terminfo[knp]"
'Up' "$terminfo[kcuu1]"
'Left' "$terminfo[kcub1]"
'Down' "$terminfo[kcud1]"
'Right' "$terminfo[kcuf1]"
'BackTab' "$terminfo[kcbt]"
)
# Do not bind any keys if there are empty values in $key_info.
for key in "$key_info[@]"; do
if [[ -z "$key" ]]; then
print "omz: one or more keys are non-bindable" >&2
return 1
fi
done
bindkey ' ' magic-space
bindkey "$key_info[Up]" history-substring-search-up
bindkey "$key_info[Down]" history-substring-search-down
bindkey "$key_info[Home]" beginning-of-line
bindkey "$key_info[End]" end-of-line
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
bindkey "$key_info[Delete]" delete-char
##############################################################################
# theme configuration
##############################################################################
export SPACESHIP_TIME_SHOW=true
##############################################################################
# User configuration
##############################################################################
# List directory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
[ -d ~/.config/composer/vendor/bin ] && export PATH="$PATH:$HOME/.config/composer/vendor/bin"
[ -f ~/.zshalias ] && source ~/.zshalias
[ -f ~/.zshrc_completion ] && source ~/.zshrc_completion
# for gpg-agent
GPG_TTY=$(tty)
export GPG_TTY
echo
echo " Welcome "$USER" on `hostname` !"
echo
export WORKON_HOME=$HOME/.virtualenvs
[ -f /usr/bin/virtualenvwrapper.sh ] && source /usr/bin/virtualenvwrapper.sh