-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
73 lines (60 loc) · 1.84 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
#!/bin/zsh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export GIT_MERGE_AUTOEDIT=no
if [[ `uname -s` == 'Darwin' ]]; then
export BREW_PREFIX=/opt/homebrew
PATH=$BREW_PREFIX/bin:$BREW_PREFIX/sbin:$PATH
fi
if [ $SPIN ]; then
spin_zshrc='/etc/zsh/zshrc.default.inc.zsh'
[[ -e "$spin_zshrc" ]] && source "$spin_zshrc"
fi
export PATH
export EDITOR=vim
# History
if [ -z $HISTFILE ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_reduce_blanks
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
setopt interactivecomments
# search up/down by taking the current line content into account
bindkey -M viins '^[[A' history-beginning-search-backward
bindkey -M viins '^[[B' history-beginning-search-forward
bindkey -M vicmd 'k' history-beginning-search-backward
bindkey -M vicmd 'j' history-beginning-search-forward
# Incremental search
bindkey -M vicmd "/" history-incremental-search-backward
bindkey -M vicmd "?" history-incremental-search-forward
bindkey -M viins '^p' history-incremental-pattern-search-backward
bindkey -M viins '^n' history-incremental-pattern-search-forward
# Edit line in vim
autoload -U edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
bindkey -v
disable -r time # disable shell reserved word
alias time='time -p ' # -p for POSIX output
bindkey -M vicmd 'u' undo
# load custom functions
source ~/.functions
for function in ~/.zsh/functions/*; do
source $function
done
source ~/.completions
source ~/.aliases
source ~/.private_profile
source ~/.prompt
source ~/.fzfrc
if [[ `uname -s` == 'Darwin' ]]; then
source $BREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi