-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathzshrc
134 lines (107 loc) · 3.1 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
# -*- mode: sh -*-
export ZSHDIR=$HOME/config/dotfiles/zsh
export LOCALDIR=$HOME/.zsh_local
export PATH=$PATH:$HOME/.bin
fpath=($ZSHDIR/zsh-completions/src $fpath)
function load_config() {
if [[ -f $1 ]] {
source $1
}
}
load_config $LOCALDIR/pre
# load extra modules
autoload -U zmv
autoload -Uz vcs_info
autoload run-help
zmodload -i zsh/complist
### OPTIONS ###
setopt correct no_correct_all
#Do hashing
setopt hash_cmds hash_dirs hash_list_all
unsetopt print_exit_value
#dont wait or ask when `rm *`
setopt no_rm_star_wait rm_star_silent
setopt short_loops
### expansion+globbing options
setopt brace_ccl brace_expand
setopt equals
setopt rc_expand_param
unsetopt magic_equal_subst mark_dirs nomatch sh_glob
### history options
setopt append_history
setopt hist_allow_clobber ### add '|' to output redirections in the history.
setopt no_hist_beep
#keep historyfile clean
setopt hist_ignore_dups hist_ignore_all_dups hist_save_no_dups hist_ignore_space hist_no_store
setopt hist_verify
setopt hist_reduce_blanks inc_append_history share_history
### completion options
setopt auto_param_keys ### intelligently remove automatically inserted characters
#add slash when completing dir but remove intelligently
setopt auto_param_slash auto_remove_slash
setopt complete_aliases complete_in_word
setopt list_ambiguous
setopt list_types
unset list_beep
### script+function options
setopt function_arg_zero
setopt local_options
setopt multios
setopt no_verbose
setopt no_xtrace
setopt local_traps
setopt local_options
### prompt options
setopt prompt_subst
setopt prompt_percent
setopt emacs
setopt interactive_comments
### cd options
setopt auto_pushd pushd_ignore_dups
setopt chase_dots chase_links
setopt auto_cd
export PROMPT="%F{green}%n@%m %~ %#> %F{white}"
if [[ -d $ZSHDIR ]] {
load_config $ZSHDIR/colors
load_config $ZSHDIR/dirhash
load_config $ZSHDIR/alias
load_config $ZSHDIR/functions/common
load_config $ZSHDIR/auto_rehash
load_config $ZSHDIR/abbrev_expansion
load_config $ZSHDIR/completion
load_config $ZSHDIR/extensions
load_config $ZSHDIR/bindkey
case "$TERM" in
linux)
;;
dumb)
export PROMPT="%F{green}%n@%m %d %#> %F{white}"
;;
*) load_config $ZSHDIR/prompt
;;
esac
load_config $ZSHDIR/style
}
load_config $LOCALDIR/post
load_config $ZSHDIR/zsh-substring-search/zsh-history-substring-search.zsh
unfunction load_config
HISTFILE=~/.zshhistory
HISTSIZE=500000
SAVEHIST=8000
export EDITOR=vim
export PAGER=less
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
# correct prompt
export SPROMPT="Correct $fg[red]%R$reset_color to $fg[green]%r$reset_color? (%Uy%ues, %Un%uo, %Ua%ubort, %Ue%udit) "
if [[ -z "$SSH_CONNECTION" ]] {
source ~/.keychain/$HOST-sh
source ~/.keychain/$HOST-sh-gpg
}
# only allow user to read and write by default
umask 077