-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshrc
91 lines (74 loc) · 2.5 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
#
# Executes commands at the start of an interactive session.
#
export PATH="/opt/homebrew/bin:$PATH"
## Operating system-specific variables
case "$OSTYPE" in
"darwin"*) : $(brew --prefix) ;; # macOS
"linux"*) : "/usr" ;; # Linux
*) : exit 1 ;;
esac
# Set the variable from the case statement
PREFIX="$_"
# Try to correct the spelling of commands
setopt correct
# Smartcase tab completion
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
# zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting)
ZSH_SYNTAX_HIGHLIGHTING="$PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
if test -f "$ZSH_SYNTAX_HIGHLIGHTING"; then
source "$ZSH_SYNTAX_HIGHLIGHTING"
fi
# zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions)
ZSH_AUTOSUGGESTIONS="$PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
if test -f "$ZSH_AUTOSUGGESTIONS"; then
source "$ZSH_AUTOSUGGESTIONS"
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
ZSH_AUTOSUGGEST_HISTORY_IGNORE="git *|cd *"
fi
# Enable colorized output for `ls` command
alias ls="ls -G"
# Set default editor
export EDITOR="code --wait"
# Homebrew formulae with executables in $(brew --prefix)/sbin
#if type brew &>/dev/null; then
export PATH="$(brew --prefix)/sbin:$PATH"
#fi
# Homebrew completions (https://docs.brew.sh/Shell-Completion)
if type brew &>/dev/null; then
# get the Homebrew-managed zsh site-functions on FPATH
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fi
# Enable the default zsh completions
autoload -Uz compinit && compinit
# rbenv (https://github.com/rbenv/rbenv)
if command -v rbenv &>/dev/null; then
# load rbenv automatically
eval "$(rbenv init -)"
fi
# pyenv (https://github.com/pyenv/pyenv)
if command -v pyenv &>/dev/null; then
# enable shims and autocompletion
eval "$(pyenv init -)"
fi
# nodenv (https://github.com/nodenv/nodenv)
if command -v nodenv &>/dev/null; then
# load nodenv automatically
eval "$(nodenv init -)"
fi
# Pipenv (https://github.com/pypa/pipenv)
if command -v pipenv &>/dev/null; then
# respect pyenv’s global and local Python versions
export PIPENV_PYTHON="$PYENV_ROOT/shims/python"
# enable shell completion
eval "$(_PIPENV_COMPLETE=zsh_source pipenv)"
fi
# Starship (https://github.com/starship/starship)
if command -v starship &>/dev/null; then
eval "$(starship init zsh)"
fi
# 1Password CLI (https://developer.1password.com/docs/cli)
if command -v op &>/dev/null; then
# enable shell completion
eval "$(op completion zsh)"; compdef _op op
fi