-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
142 lines (116 loc) · 3.39 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#zmodload zsh/zprof
# GENERAL
export EDITOR="nvim"
# Load tokens
[ -f .tokens ] && source .tokens
# NVM
export NVM_LAZY_LOAD=true
# Go
export PATH="$PATH:$(go env GOBIN):$(go env GOPATH)/bin"
{{- if eq .chezmoi.os "darwin" }}
# BREW
if [ -d "/opt/homebrew/bin" ]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
if [ -d "/opt/homebrew/sbin" ]; then
export PATH="/opt/homebrew/sbin:$PATH"
fi
alias bdu='brew doctor; brew update; brew upgrade'
{{- end }}
# ANTIDOTE
{{- if eq .chezmoi.os "linux" }}
source '/usr/share/zsh-antidote/antidote.zsh'
{{- else }}
source $(brew --prefix)/opt/antidote/share/antidote/antidote.zsh
{{- end }}
antidote load
autoload -Uz promptinit && promptinit && prompt pure
{{- if eq .chezmoi.os "linux" }}
# Backwards search with Ctrl-R
bindkey "^R" history-substring-search-down
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
# Store SSH passphrases
eval $(keychain --eval --quiet --confhost)
# Grim - Screenshot tool
export GRIM_DEFAULT_DIR="~/screenshots"
# Clipcat clipboard manager
if type clipcat-menu >/dev/null 2>&1; then
alias clipedit=' clipcat-menu --finder=builtin edit'
alias clipdel=' clipcat-menu --finder=builtin remove'
bindkey -s '^\' "^Q clipcat-menu --finder=builtin insert ^J"
bindkey -s '^]' "^Q clipcat-menu --finder=builtin remove ^J"
fi
{{- end }}
# FZF
source <(fzf --zsh)
export FZF_DEFAULT_OPTS='--height 40% --layout reverse --border top'
export FZF_CATPPUCCIN_MACCHIATO=" \
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#b7bdf8,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796 \
--color=selected-bg:#494d64 \
--multi \
"
export FZF_THEME=$FZF_CATPPUCCIN_MACCHIATO
export FZF_DEFAULT_OPTS=" \
--height 30% -1 \
--select-1 \
--reverse \
--preview-window='right:wrap' \
--inline-info \
$FZF_THEME
"
# VIM
alias vi='nvim'
alias vim='nvim'
# LSD
alias ls='lsd'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
# Git
alias lg="lazygit"
function lg()
{
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
lazygit "$@"
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
fi
}
# COMPOSER
export PATH="$PATH:$(composer global config bin-dir --absolute --quiet)"
{{- if eq .chezmoi.os "darwin" }}
# PHP
# determine versions of PHP installed with HomeBrew
installedPhpVersions=($(brew ls --versions | ggrep -E 'php(@.*)?\s' | ggrep -oP '(?<=\s)\d\.\d' | uniq | sort))
# create alias for every version of PHP installed with HomeBrew
for phpVersion in ${installedPhpVersions[*]}; do
value="{"
for otherPhpVersion in ${installedPhpVersions[*]}; do
if [ "${otherPhpVersion}" = "${phpVersion}" ]; then
continue;
fi
value="${value} brew unlink php@${otherPhpVersion};"
done
value="${value} brew link php@${phpVersion} --force --overwrite; } &> /dev/null && php -v"
alias "${phpVersion}"="${value}"
done
{{- end }}
#MINICONDA
{{- if eq .chezmoi.os "darwin" }}
CONDA_DIR="/opt/homebrew/Caskroom/miniconda/base"
{{- else }}
CONDA_DIR="/home/hl/miniconda3"
{{- end }}
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if [ -f "$CONDA_DIR/etc/profile.d/conda.sh" ]; then
. "$CONDA_DIR/etc/profile.d/conda.sh"
else
export PATH="$CONDA_DIR/bin:$PATH"
fi
# <<< conda initialize <<<
#zprof