-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
211 lines (171 loc) · 5.1 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Make sure zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/zplug/zplug ~/.zplug && \
source ~/.zplug/init.zsh && \
zplug update --verbose
else
source ~/.zplug/init.zsh
fi
## begin zplug ##
zplug "zplug/zplug"
# Theme
eval "$(starship init zsh)"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions"
# For node
#zplug "tj/n", use:"bin/n", as:command
# oh-my-zsh features
zplug "lib/completion", from:oh-my-zsh
zplug "lib/key-bindings", from:oh-my-zsh
# scripts
#zplug "trapd00r/ls--", as:command, use:"ls++", if:"type perl > /dev/null", hook-build:"cp ~/.zplug/repos/trapd00r/ls--/ls++.conf ~/.ls++.conf"
#zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:fzf
#zplug "so-fancy/diff-so-fancy", as:command, use:"third_party/build_fatpack/diff-so-fancy"
#zplug "denilsonsa/prettyping", as:command, use:"prettyping"
# Recommended installs:
#
# https://github.com/dandavison/delta
#if [[ "$OSTYPE" == "linux-gnu" ]]
#then
# # These from GitHub releases only have Linux releases.
# if ! command -v bat >/dev/null 2>&1
# then
# zplug "sharkdp/bat", \
# as:command, \
# from:gh-r, \
# use:"*x86_64*linux-gnu*", \
# rename-to:bat
# fi
#
# if ! command -v fd >/dev/null 2>&1
# then
# zplug "sharkdp/fd", \
# as:command, \
# from:gh-r, \
# use:"*x86_64*linux-gnu*", \
# rename-to:fd
# fi
#
# if ! command -v hexyl >/dev/null 2>&1
# then
# zplug "sharkdp/hexyl", \
# as:command, \
# from:gh-r, \
# use:"*x86_64*linux-gnu*", \
# rename-to:hexyl
# fi
#
# if ! command -v tldr >/dev/null 2>&1
# then
# zplug "dbrgn/tealdeer", \
# as:command, \
# from:gh-r, \
# use:"*x86_64*", \
# rename-to:tldr
# fi
#
# if ! command -v exa >/dev/null 2>&1
# then
# zplug "ogham/exa", \
# as:command, \
# from:gh-r, \
# use:"*linux*", \
# rename-to:exa
# fi
#else
#fi
# Install plugins that are not installed
if ! zplug check --verbose; then
zplug install
fi
# Then, source plugins and add commands to $PATH
zplug load
## end zplug ##
# Misc zsh config
HISTFILE=~/.zsh_history
HISTSIZE=2000
SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
# Highlighting rules
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=240
if type fd >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND="fd --type f --exclude .git"
fi
# Go
if type go >/dev/null 2>&1; then
export GOPATH=~/go
export PATH="$PATH:$GOPATH/bin"
fi
# Node
if type n >/dev/null 2>&1; then
export N_PREFIX=$HOME/.local
export PATH=$N_PREFIX/bin:$PATH
fi
# Cargo
if type cargo >/dev/null 2>&1; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
export PATH="${HOME}/.local/bin:/opt/homebrew/bin:${PATH}"
# Machine specific
if [ -f ~/.zsh_machine ]; then
. ~/.zsh_machine
fi
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Start of customisations
# If you are using multiple shells with zsh, the history will be inconsistent
# unless this option is set in each shell.
setopt share_history
fpath+=~/.zfunc
test -e "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" && \
source "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
test -e "$HOME/.profile" && source "$HOME/.profile"
source "$HOME/.aliases"
# Function to display external IP address
ext-ip() { curl http://ipecho.net/plain; echo }
# Autosuggest is ctrl+space
#bindkey '^ ' autosuggest-accept
# Preferred editor for local and remote sessions
#if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
#elif [[ "$OSTYPE" == "darwin"* ]]
#then
# export EDITOR='vim'
#else
# export EDITOR="gvim"
#fi
# To use a different version of Java, simply change the "1.8" to whichever version you want.
#test -e "/usr/libexec/java_home" && export JAVA_HOME="`/usr/libexec/java_home -v 1.8`"
#export NVM_DIR="$HOME/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# Bash completion for IBM Cloud API
#test -e /usr/local/ibmcloud/autocomplete/zsh_autocomplete && \
# source /usr/local/ibmcloud/autocomplete/zsh_autocomplete
if [[ "$OSTYPE" == "darwin"* ]]
then
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
fi
# Wasmer
#export WASMER_DIR="$HOME/.wasmer"
#[ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh