forked from tpounds/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
123 lines (101 loc) · 2.71 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
# Go ʕ◔ϖ◔ʔ
export GOPATH=~/go
# Fix Java UI window parenting with AwesomeWM.
#
# see: http://awesome.naquadah.org/wiki/Problems_with_Java
export _JAVA_AWT_WM_NONREPARENTING=1
typeset -U fpath # dedupe
fpath=(
~/.zsh/completions
~/.zsh/functions
$fpath
)
typeset -U path # dedupe
path=(
~/bin
$GOPATH/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
)
autoload -Uz bashcompinit
bashcompinit
autoload -Uz compinit
compinit
autoload -U select-word-style
select-word-style bash
# disable stop/start terminal output
stty stop undef # ctrl+s
stty start undef # ctrl+q
bindkey -e # Emacs key bindings
source ~/.zshrc.hashicorp
source ~/.zshrc.kubernetes
# configure prompt
autoload -Uz vcs_info
setopt prompt_subst
zstyle ':vcs_info:*' enable cvs git hg p4 svn
#zstyle ':vcs_info:*' stagedstr '%F{28}-%f'
#zstyle ':vcs_info:*' unstagedstr '%F{11}+%f'
#zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats '(%F{yellow}%s%f) %F{magenta}%b%f@%F{cyan}%.12i%f'
zstyle ':vcs_info:*' branchformat '%b'
zstyle ':vcs_info:*' get-revision true
zstyle ':vcs_info:*' use-simple true
precmd() {
vcs_info
# set terminal title to <user>@<host>:<cwd>
case $TERM in
rxvt*|xterm*) print -Pn '\e]0;%n@%m: %~\a' ;;
esac
}
PROMPT='%F{green}%n%f@%F{cyan}%m%f:%F{yellow}%(5~|%-1~/.../%3~|%4~)%f$ '
RPROMPT='$KUBEPS1 $vcs_info_msg_0_'
# enable brace character class e.g. {a-z}
setopt BRACE_CCL
# configure history
HISTFILE=~/.zsh/history
HISTSIZE=50000
SAVEHIST=50000
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
# help guard against accidental rm -rf *
setopt NO_RM_STAR_SILENT
setopt RM_STAR_WAIT
# Appends every command to the history file once it is executed
# setopt inc_append_history
# Reloads the history whenever you use it
setopt SHARE_HISTORY
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval `dircolors -b`
alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
# aws cli completions
command -v aws_completer >/dev/null 2>&1 && {
complete -C aws_completer aws
}
# ls: colorize output
alias ls='ls --color=auto'
# ls: use long listing format
alias ll='ls -la'
# ls: show hidden files
alias l.='ls -d .*'
# enable context aware ignore case search and colorize output
alias less='less -i -r'
# default to opening multiple files in tabs
alias vi="$(whence -p vi) -p"
alias vim="$(whence -p vim) -p"
# source z
source ~/.zsh/z/z.sh
# source private .zshrc
for rc in $(ls -a ~/.private*/.zshrc); do source $rc; done