-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
73 lines (57 loc) · 1.94 KB
/
zshrc
File metadata and controls
73 lines (57 loc) · 1.94 KB
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
# zmodload zsh/zprof
# use antidote for managing zsh plugins. clone latest version if its missing.
[[ -e ~/.antidote ]] || git clone --depth=1 https://github.com/mattmc3/antidote.git ~/.antidote
# load antidote
. ~/.antidote/antidote.zsh
# set fpath before loading plugins (needed for completions)
fpath=($HOME/.zsh $HOME/.docker/completions $fpath)
# turn on completions (must run before plugins, specifically before fzf-tab)
autoload -Uz compinit
# speed up compinit by only checking cache once a day
# https://gist.github.com/ctechols/ca1035271ad134841284
() {
setopt extendedglob local_options
if [[ -n ${ZDOTDIR:-$HOME}/.zcompdump(#qN.mh+24) ]]; then
compinit
else
compinit -C
fi
}
# use antidote static bundle for faster startup
zsh_plugins=${ZDOTDIR:-$HOME}/.zsh_plugins.zsh
[[ -f $zsh_plugins ]] || antidote bundle <~/.zsh_plugins.txt >$zsh_plugins
source $zsh_plugins
# starship prompt
eval "$(starship init zsh)"
# set paths
typeset -U PATH path
path=(
/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/usr/local/sbin
$HOME/.local/bin
$HOME/go/bin
$HOME/.cargo/bin
$path[@]
)
# include aliases
[[ -s ~/.aliases ]] && source ~/.aliases
[[ -s ~/.aliases.local ]] && source ~/.aliases.local
# fast fuzzy search bindings
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
if [[ $OSTYPE == darwin* ]] && (( $+commands[brew] )); then
# On macOS: fix clang errors, link openssl, libffi, libpq
_brew=$(brew --prefix)
export CFLAGS="-I$_brew/opt/openssl@3/include -I$_brew/opt/libffi/include"
export CPPFLAGS=$CFLAGS
export LDFLAGS="-L$_brew/opt/openssl@3/lib -L$_brew/opt/libffi/lib"
unset _brew
fi
# use mise for managing python, ruby, etc, versions
eval "$(mise activate zsh)"
# fzf-tab: directory preview on cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls -1 --color=always $realpath'
# zprof