This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
181 lines (151 loc) · 5.17 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
#!/bin/sh
###
# .zshrc
#
# @since Unknown The beginning of time.
# @since Unknown Large update, most things are ZSH plugins now.
# @since (Jan 16, 2023) Moved a ton of configurations to aubreypwd/zsh-plugin-my-config
#
# shellcheck disable=SC3030
# shellcheck disable=SC3046
##
###
# PATH
#
# See my-path.php in zsh-my-config for more.
##
export N_PREFIX="$HOME/.n"
export PATH="$N_PREFIX/bin:$PATH"
export PATH="$PATH:/opt/homebrew/bin:/opt/homebrew/sbin" # Homebrew
export PATH="$PATH:$HOME/.composer/vendor/bin" # Composer
export PATH="/opt/homebrew/opt/ruby/bin:$PATH" # Ruby
export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH" # Open SSL
export PATH="/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH" # Ruby Gems
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH" # OpenJDK.
export PATH="/Applications/UTM.app/Contents/MacOS/:$PATH" # UTM
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH" # subl
export PATH="/usr/local/mysql/bin:$PATH" # mysql installed via oracle's website.
export PATH="/Users/aubreypwd/.n/bin/:$PATH" # n node version (leave at the end).
###
# High Level Options
#
# @since Tuesday, April 19, 2022
##
export ZSH="$HOME/.oh-my-zsh" # Path to your oh-my-zsh installation.
###
# Load ZSH
#
# @since Tuesday, September 7, 2021
##
if test -e "$ZSH"; then
###
# ZSH & oh-my-zsh Specific Configs
#
# E.g:
#
# @since Thursday, 10/1/2020
##
export UPDATE_ZSH_DAYS=90
###
# Theme
#
# - Must be done before you shource oh-my-zsh.
#
# @since Monday, 9/21/2020 frisk
# @since 10/1/20 ys
# @since Wednesday, 10/7/2020 Switched to refined for more simplicity.
# @since Apr 6, 2023 Turned off for custom PS1 Prompt.
##
# export ZSH_THEME="refined"
# Built-in plugins.
export PLUGINS=()
# Load Oh My ZSH...
source "$ZSH/oh-my-zsh.sh"
###
# Used to clone and link plugins below.
#
# @since Jan 16, 2023
##
_clone-and-link-antigen-bundle () {
if test ! -x "$(command -v ghq)"; then
echo "_clone-and-link-antigen-bundle: Please install ghq, can't clone plugin $1."
fi
ghq get -s "ssh://[email protected]/$1" 2> /dev/null
antigen bundle "$HOME/Repos/github.com/$1" --no-local-clone
}
###
# Antigen Plugins
#
# I use Antigen to source my various zsh functions and aliases, etc.
#
# - Think of "bundle" as "plugin".
# - E.g. `Tarrasch/zsh-bd` should clone from Github by default
# - Cloning using ssh URL ensures the resutling clone is contributable upstream with 2FA
#
# @see $HOME/.antigen/bundle Where the repos are cloned and sourced from.
# @see https://github.com/zsh-users/antigen Antigen download and info.
#
# @since Monday, 9/21/2020
##
if [ ! -f "/opt/homebrew/share/antigen/antigen.zsh" ]; then
echo "Please install antigen and reload to install ZSH plugins:"
echo " Homebrew: brew reinstall antigen"
else
# Get antigen ready.
source /opt/homebrew/share/antigen/antigen.zsh # brew install antigen
# omz
antigen use oh-my-zsh
# Other Plugins
antigen bundle git-extras
antigen bundle history-substring-search
antigen bundle osx
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
# My plugins...
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-require" ## This has to be loaded first.
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-git-is-clean"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-x"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-reload"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-fzf-git-branch"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-hide"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-delete"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-comment"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-pwdcp"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-cvideo"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-yt2mp3"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-fd"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-download"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-newvwp"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-bruse"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-affwp"
_clone-and-link-antigen-bundle "aubreypwd/zsh-plugin-my-config" # This should be loaded last.
antigen cache-gen
antigen apply
antigen cleanup --force 2>&1 /dev/null
fi
else
echo ".oh-my-zsh isn't installed!"
echo " Install: https://ohmyz.sh/#install"
exit 2
fi
# Autocomplete
autoload -Uz compinit && compinit
# fzf
test -f "$HOME/.fzf.zsh" && \
source "$HOME/.fzf.zsh"
# iTerm2
test -e "${HOME}/.iterm2_shell_integration.zsh" \
&& source "${HOME}/.iterm2_shell_integration.zsh"
# Only when loaded $HOME...
if test "$(pwd)" = "$HOME"; then
repo-statuses
sysinfo
fi
# Show git status in repos.
if [ -e "./.git" ]; then git s; fi
export GPG_TTY=$(tty)
if [[ "$TERM_PROGRAM" == 'vscode' ]]; then
alias x="echo 'Kill terminal in VSCode Instead.'"
alias exit="echo 'Kill terminal in VSCode Instead'"
fi
[[ "$TERM_PROGRAM" == "CodeEditApp_Terminal" ]] && . "/Applications/CodeEdit.app/Contents/Resources/codeedit_shell_integration.zsh"