-
Notifications
You must be signed in to change notification settings - Fork 5
/
.zshrc
55 lines (43 loc) · 1.77 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
# homebrew
[[ -r "/opt/homebrew/bin/brew" ]] && eval "$(/opt/homebrew/bin/brew shellenv)"
# starship
eval "$(starship init zsh)"
# set tab title to current dir
function set_win_title(){
echo -ne "\033]0; $(basename "$PWD") \007"
}
precmd_functions+=(set_win_title)
# set tab title to program (pre-execution)
preexec() { printf "\033]0; `history $HISTCMD | cut -b7-` \007"; }
# two above seem to coexist okay. shruggerooney
# note that order matters here, zsh completions/suggestions/etc
# can conflict with each other or other stuff or not pick up important
# things to complete if they're run too early
if type brew &>/dev/null; then
# brew install zsh-completions
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
# brew install zsh-autosuggestions
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# brew install zsh-syntax-highlighting
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# brew install zsh-history-substring-search
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh
# aws tab completion
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html
if type aws &>/dev/null; then
complete -C '/opt/homebrew/bin/aws_completer' aws
fi
fi
# case insensitive path-completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' menu select
# home/end keys be normal ffs
bindkey '\e[H' beginning-of-line
bindkey '\e[F' end-of-line
# up/down for substring search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# write to history across multiple sessions simultaneously
setopt share_history