-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
85 lines (64 loc) · 2.47 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
# interactive usage
# (read when interactive)
#
# usage examples:
#
# - prompt
# - command completion
# - aliases
# Colors.
unset LSCOLORS
export CLICOLOR=1
export CLICOLOR_FORCE=1
# Don't require escaping globbing characters in zsh.
unsetopt nomatch
# Custom $PATH with extra locations.
export PATH=$HOME/Library/Python/3.8/bin:/opt/homebrew/bin:/usr/local/bin:/usr/local/sbin:$HOME/bin:$HOME/go/bin:/usr/local/git/bin:$HOME/.composer/vendor/bin:$PATH
# Include alias file (if present) containing aliases for ssh, etc.
if [ -f ~/.aliases ]
then
source ~/.aliases
fi
# Set architecture-specific brew share path.
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
share_path="/usr/local/share"
elif [ "${arch_name}" = "arm64" ]; then
share_path="/opt/homebrew/share"
else
echo "Unknown architecture: ${arch_name}"
fi
# Allow history search via up/down keys.
source ${share_path}/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey "^[[A" history-substring-search-up
bindkey "^[[B" history-substring-search-down
# Completions.
autoload -Uz compinit && compinit
# Case insensitive.
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
# Tell homebrew to not autoupdate every single time I run it (just once a week).
export HOMEBREW_AUTO_UPDATE_SECS=604800
# history
HISTSIZE=50000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=50000 #Number of history entries to save to disk
HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
# editor
EDITOR=vim
# oh-my-zsh
export ZSH="$HOME/.oh-my-zsh"
plugins=(git brew history kubectl history-substring-search last-working-dir)
source $ZSH/oh-my-zsh.sh
# starship
eval "$(starship init zsh)"
eval "$(pyenv init -)"
# [fx](https://github.com/antonmedv/fx)
export FX_THEME=4
# export PYENV_ROOT="$HOME/.pyenv"
# command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv virtualenv-init -)"
eval "$(direnv hook zsh)"
export PATH="$PATH:$(go env GOPATH)/bin"