-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
100 lines (85 loc) Β· 2.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
# zmodload zsh/zprof
#
# Prompt
# https://github.com/sindresorhus/pure
#
autoload -U promptinit; promptinit
PURE_GIT_DOWN_ARROW=β
PURE_GIT_UP_ARROW=β
# PURE_PROMPT_SYMBOL=π¦
prompt pure
zstyle :prompt:pure:git:stash show yes
export CLICOLOR=1
CASE_SENSITIVE="true"
DISABLE_UPDATE_PROMPT="true"
DISABLE_AUTO_TITLE="true"
ENABLE_CORRECTION="true"
# Skip forward/back a word with opt-arrow
bindkey '^[f' forward-word
bindkey '^[b' backward-word
#
# History
#
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HIST_STAMPS="yyyy-mm-dd"
HISTSIZE=50000
SAVEHIST=10000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt inc_append_history
setopt share_history
#
# Changing directories
#
setopt auto_cd
setopt auto_pushd
unsetopt pushd_ignore_dups
setopt pushdminus
#
# Completion
#
autoload -Uz compinit
for dump in ~/.zcompdump(N.mh+24); do
compinit
done
compinit -C
setopt auto_menu
setopt always_to_end
setopt complete_in_word
unsetopt flow_control
unsetopt menu_complete
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
# Highlight the current autocomplete option
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# Better SSH/SCP/Rsync Autocomplete
h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:(ssh|scp|rsync|slogin):*' hosts $h
fi
if [[ $(uname -m) == 'arm64' ]]; then
PATH_HOMEBREW=/opt/homebrew
else
PATH_HOMEBREW=/usr/local
fi
source $PATH_HOMEBREW/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $PATH_HOMEBREW/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# source <(kubectl completion zsh)
#
# Other
#
setopt prompt_subst
source ~/.exports
source ~/.aliases
source ~/.private