-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
134 lines (110 loc) · 2.82 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
#
# .zshrc
#
# 2007 onwards Jonathan Sokolowski
#
export ZSH=$HOME/.zsh
# awesome cd movements from zshkit
setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars
DIRSTACKSIZE=5
# Enable extended globbing
setopt extendedglob
# Allow [ or ] whereever you want
unsetopt nomatch
umask 022
limit coredumpsize 0
export VISUAL=vim
export EDITOR=$VISUAL
# Colour support all round
autoload -U colors
colors
export CLICOLOR=1
if (grep --help 2>/dev/null |grep -- --color) >/dev/null; then
alias grep='grep --color=auto'
fi
# ZSH Options
setopt APPEND_HISTORY
setopt AUTO_LIST
setopt AUTO_MENU
setopt AUTO_REMOVE_SLASH
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt IGNORE_EOF
setopt INTERACTIVE_COMMENTS
setopt LIST_TYPES
setopt LONG_LIST_JOBS
setopt NO_HUP
setopt RC_QUOTES
#
# History
export HISTFILE="${HOME}/.zhistory"
alias hist='fc -RI' # Import History
setopt INC_APPEND_HISTORY
unsetopt LIST_AMBIGUOUS
setopt AUTO_LIST
setopt AUTO_MENU
setopt AUTO_REMOVE_SLASH
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt EXTENDED_HISTORY
setopt INTERACTIVE_COMMENTS
setopt LIST_TYPES
setopt LONG_LIST_JOBS
setopt NO_HUP
setopt RC_QUOTES
export HISTSIZE=10000
export SAVEHIST=10000
setopt completeinword
bindkey -e
bindkey '\e[1~' beginning-of-line
bindkey '\e[2~' overwrite-mode
bindkey '\e[3~' delete-char
bindkey '\e[4~' end-of-line
bindkey '\e[5~' beginning-of-history
bindkey '\e[5~' end-of-history
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
#
# VCS info
#
autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' max-exports 2
# vcs_info_msg_0_ is the current branch name (used by prompt)
# vcs_info_msg_1_ is the repository root directory name (used by tmux)
zstyle ':vcs_info:git*' formats '%b ' '%r'
#
# Load completion subsystem
#
autoload -Uz compinit
compinit
#
# Ad-hoc plugin system
#
# Append to plugins with: plugins=($my_plugins $plugins)
plugins=(homebrew completions prompt base16)
[[ -f ~/.aliases ]] && source ~/.aliases
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
[[ -f ~/.zshrc.host ]] && source ~/.zshrc.host
should_add_to_fpath() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
for name ($plugins); do
echo "Loading plugin: $name"
if should_add_to_fpath $ZSH $name; then
fpath=($ZSH/plugins/$name $fpath)
fi
source $ZSH/plugins/$name.zsh
done
zstyle ':completion:*' completer _expand _complete _history
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' insert-unambiguous true
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-z}={A-Z} r:|[._-]=* r:|=*'
zstyle ':completion:*' menu select=4