-
Notifications
You must be signed in to change notification settings - Fork 14
/
.zshrc
52 lines (44 loc) · 1.3 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
#!/usr/bin/env zsh
# history
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=100000
export SAVEHIST=100000
# keybindings
bindkey -e
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
WORDCHARS='~!#$%^&*(){}[]<>?+;-_'
# no cd
setopt auto_cd
# source z'goodies
if [[ -n "$HOMEBREW_PREFIX" ]]; then
# extra keybindings for win/linux compat
bindkey "^[[3;5~" kill-word
source $HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
else
# not a login shell in WSL
source $HOME/.zprofile
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# launch completion system
autoload -U compinit && compinit
autoload -U +X bashcompinit && bashcompinit
# source other zsh files
for zfile in "${ZSH:-$HOME/.config/zsh}"/*.zsh; do
source "$zfile"
done
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.config/zsh/custom}"
if [[ -d $ZSH_CUSTOM ]]; then
for zfile in "$ZSH_CUSTOM"/*.zsh; do
source "$zfile"
done
fi
# enable substitution in the prompt
setopt prompt_subst
# config for prompt
prompt='%B%F{blue}%1/%f%b %F{green}$(git_prompt_branch)%f$ '