-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
118 lines (94 loc) · 2.74 KB
/
dot_zshrc.tmpl
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{{ template "load_zfunctions.zsh" }}
typeset -U path PATH
export SHELL="/bin/zsh"
export EDITOR="{{ .editor }}"
export VISUAL="{{ .visual }} --wait"
export GIT_EDITOR="{{ .editor }}"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
SHELL_SESSIONS_DISABLE=1
HISTFILE="$HOME/.zsh_history_extended"
HISTSIZE=50000
SAVEHIST=20000
setopt APPEND_HISTORY
setopt SHARE_HISTORY
# setopt EXTENDED_HISTORY # Not needed with SHARE_HISTORY
# setopt INC_APPEND_HISTORY # Not needed with SHARE_HISTORY
setopt HIST_IGNORE_DUPS
# setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt NO_LIST_BEEP
setopt CORRECT
setopt IGNORE_EOF
# setopt COMPLETE_IN_WORD
# homebrew
if [ -x "{{ .homebrew_prefix }}/bin/brew" ]; then
eval "$({{ .homebrew_prefix }}/bin/brew shellenv)"
fi
# fish(y)
source "{{ .homebrew_prefix }}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
source "{{ .homebrew_prefix }}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "{{ .homebrew_prefix }}/share/zsh-history-substring-search/zsh-history-substring-search.zsh"
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# navigation
source "{{ .homebrew_prefix }}/etc/profile.d/z.sh"
{{ if eq .chezmoi.os "darwin" }}
# xcode
export SDKROOT="$(xcrun --show-sdk-path)"
{{ end }}
# java
export JAVA_HOME="$HOME/.local"
# pkgx
if command -v pkgx &> /dev/null; then
source <(pkgx --shellcode)
source "$HOME/.config/pkgx/hooks.zsh"
fi
# TODO: use pkgx postgres instead
if [ -d "{{ .homebrew_prefix }}/opt/postgresql@15/bin" ]; then
path[1,0]="{{ .homebrew_prefix }}/opt/postgresql@15/bin"
fi
# user paths
path[1,0]="/usr/local/bin"
path[1,0]="$HOME/.local/bin"
path[1,0]="$HOME/.gem/bin"
path[1,0]="$HOME/bin"
# Fix rubygems
# export GEM_HOME=$(pkgx ruby -e 'puts Gem.user_dir')
# fzf
source $HOME/.config/fzf/key-bindings.zsh
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!doc/*"'
# ripgrep
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config"
# zoxide
eval "$(zoxide init zsh)"
# starship
if [ -f "$HOME/.config/hooks/starship.toml" ]; then
# hook to override default ~/.config/starship.toml
export STARSHIP_CONFIG="$HOME/.config/hooks/starship.toml"
fi
export STARSHIP_LOG="error" # silence timeout warnings
eval "$(starship init zsh)"
{{ if eq .editor "nvim" }}
# use nvim for man
export MANPAGER="nvim +Man!"
{{ end }}
# neovim
alias vi=nvim
alias vim=nvim
alias tree='et'
# ls
alias ls="lsd -1"
alias ll="lsd -1"
alias la="lsd -la"
alias lh="lsd -1ad .*" # list only hidden files
# diff
alias diff="diff --color=always --suppress-common-lines"
# kitty
alias themes="kitten themes"
alias fonts="kitten choose-font"
if [[ -o login ]]; then
source "$HOME/.config/zsh/login_checks"
fi