-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
executable file
·188 lines (155 loc) · 5.78 KB
/
.zshrc
File metadata and controls
executable file
·188 lines (155 loc) · 5.78 KB
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
# Enable p10k-instant-prompt
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
############################
# Environment Setup
############################
export DISABLE_AUTO_TITLE=true
export EDITOR='nvim'
export LANG=en_US.UTF-8
export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:"
export NVM_DIR=$HOME/.nvm
export PNPM_HOME=$HOME/Library/pnpm
export TERM="xterm-256color"
export ZPLUG_HOME=$HOME/.zplug
export ANTHROPIC_MODEL="sonnet[1m]"
# GO
export GOPATH=$HOME/go
# Android
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
# Path
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$GOPATH/bin
export PATH=$PNPM_HOME:$PATH
export PATH=/opt/local/bin:/opt/local/sbin:$HOME/.cargo/bin:$PATH
export PATH=$PATH:$HOME/flutter/bin
export PATH="$PATH:/Users/underwoc/.local/bin"
# Appends every command to the history file once it is executed
setopt inc_append_history
# Reloads the history whenever you use it
setopt share_history
############################
# Plugin Settings
############################
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
ENABLE_CORRECTION="true"
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=247'
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE="true"
############################
# Sourced Files / Utilities
############################
#for f in ~/.scripts/sourced/*; do
# . $f
#done
[[ ! -f $HOME/.secrets ]] || source $HOME/.secrets
[[ ! -f $HOME/.cargo/env ]] || source $HOME/.cargo/env
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
eval "$(rbenv init - zsh)"
# fix nvim breaking cursor
_fix_cursor() {
echo -ne '\e[5 q'
}
precmd_functions+=(_fix_cursor)
############################
# Aliases
############################
alias cls="colorls --dark"
alias diskspace="du -S | sort -n -r | less"
alias dockspace="defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock"
alias dots="git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
alias dotsupdate="dotfiles pull && dotfiles submodule update"
alias glog="git log --all --decorate --oneline --graph"
alias gprune="git fetch -p && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D"
alias grep="grep --color=auto"
alias l="ls --color=auto"
alias la="ls -lah --color=auto"
alias lh="ls -lh --color=auto"
alias logs="find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"
alias ls="ls --color=auto"
alias pullrepos="for i in */.git; do ( echo $i; cd $i/..; git pull; ); done"
alias up="cd $(eval printf '../'%.0s {1..$1}) && pwd;"
alias zconfig="vim ~/.zshrc"
alias zreload="exec zsh"
alias npmt="npm run test"
alias ftest='flutter test | grep -F "[E]"'
alias icerts="xcrun simctl keychain booted add-root-cert '/Library/Application Support/Netskope/STAgent/data/nscacert.pem'"
############################
# Plugins
############################
# make sure we have zplug installed
if [[ ! -d $HOME/.zplug ]]; then
printf 'Install zplug? [y/N]: '
if read -q; then
echo; git clone https://github.com/b4b4r07/zplug ~/.zplug
fi
fi
if [[ -f $HOME/.zplug/init.zsh ]]; then
source $HOME/.zplug/init.zsh
# oh-my-zsh
zplug "plugins/colored-man-pages", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/common-aliases", from:oh-my-zsh
zplug "plugins/copyfile", from:oh-my-zsh
zplug "plugins/debian", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/docker-compose", from:oh-my-zsh
zplug "plugins/dotenv", from:oh-my-zsh
zplug "plugins/flutter", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/go", from:oh-my-zsh
zplug "plugins/jsontools", from:oh-my-zsh
zplug "plugins/macOS", from:oh-my-zsh
zplug "plugins/node", from:oh-my-zsh
zplug "plugins/npm", from:oh-my-zsh
zplug "plugins/nvm", from:oh-my-zsh
zplug "plugins/pylint", from:oh-my-zsh
zplug "plugins/python", from:oh-my-zsh
zplug "plugins/systemd", from:oh-my-zsh
zplug "plugins/thefuck", from:oh-my-zsh
zplug "plugins/tmux", from:oh-my-zsh
zplug "plugins/vscode", from:oh-my-zsh
zplug "plugins/web-search", from:oh-my-zsh
# zplug "plugins/yarn", from:oh-my-zsh
# prezto
zplug "modules/completion", from:prezto
zplug "modules/directory", from:prezto
# commands
zplug "so-fancy/diff-so-fancy", as:command
# zsh users
#zplug "jeffreytse/zsh-vi-mode"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "romkatv/powerlevel10k", as:theme
zplug "zsh-users/zsh-syntax-highlighting"
# themes / appearance
if ! zplug check --verbose; then
printf 'Install Plugins? [y/N]: '
if read -q; then
echo; zplug install
fi
fi
zplug load
fi
#############################
# Keybindings
############################
bindkey -v
# Keybindings for substring search plugin. Maps up and down arrows.
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# ctrl+p and ctrl+n for previous next
bindkey "^P" history-substring-search-up
bindkey "^N" history-substring-search-down
# ctrl+space to accept the auto suggestion
bindkey '^ ' autosuggest-accept
# fix zsh bug where backspace breaks after exiting insert mode
bindkey "^?" backward-delete-char
# fix home and end keys
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[[ -f /Users/underwoc/.dart-cli-completion/zsh-config.zsh ]] && . /Users/underwoc/.dart-cli-completion/zsh-config.zsh || true