-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.zshrc
240 lines (189 loc) · 6.39 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#=====
# Oh-My-Zsh
#=====
export ZSH="$HOME/.oh-my-zsh"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
plugins=(
git
notify
alias-tips
colored-man-pages
# zsh-vi-mode
)
autoload -Uz compinit
compinit
ZSH_THEME=""
[[ -e $ZSH/oh-my-zsh.sh ]] && source $ZSH/oh-my-zsh.sh
#========
# Zsh Syntax Highlighting & Autosuggestions; Installed via Homebrew
#========
[[ -e "$HOMEBREW_PREFIX/opt/zsh-syntax-highlighting/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] && source "$HOMEBREW_PREFIX/opt/zsh-syntax-highlighting/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[[ -e "$HOMEBREW_PREFIX/opt/zsh-autosuggestions/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]] && source "$HOMEBREW_PREFIX/opt/zsh-autosuggestions/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
#========
# NNN configuration
#========
n ()
{
# Block nesting of nnn in subshells
[ "${NNNLVL:-0}" -eq 0 ] || {
echo "nnn is already running"
return
}
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see. To cd on quit only on ^G, remove the "export" and make sure not to
# use a custom path, i.e. set NNN_TMPFILE *exactly* as follows:
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The command builtin allows one to alias nnn to n, if desired, without
# making an infinitely recursive alias
command nnn "$@"
[ ! -f "$NNN_TMPFILE" ] || {
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
}
}
nnn_cd()
{
if ! [ -z "$NNN_PIPE" ]; then
printf "%s\0" "0c${PWD}" > "${NNN_PIPE}" !&
fi
}
trap nnn_cd EXIT
#========
# Walk
#========
function wl {
cd "$(walk "$@")"
}
#========
# Pure Prompt
#========
fpath+=/opt/homebrew/share/zsh/site-functions # this is needed for m1 installation
autoload -U promptinit
promptinit
PURE_PROMPT_SYMBOL=λ
prompt pure
#========
# iTerm2 & Shell Integration
#========
[[ -e "$HOME/.config/iterm2/.iterm2_shell_integration.zsh" ]] && source "$HOME/.config/iterm2/.iterm2_shell_integration.zsh"
#=======
# Aliases
#=======
alias dr="yadm bootstrap" # dotfiles refresh/rerun
alias pubkey="more ~/.ssh/id_ed25519.pub | pbcopy | echo '=> Public key copied to pasteboard.'" # copy public key to clipboard
alias zf="nvim ~/.zshrc"
alias vf="nvim ~/.config/nvim/init.vim"
alias rl="source ~/.zshrc"
alias j="fasd_cd -d"
alias f="rg"
alias ow="find *.xcworkspace | head -n 1 | xargs open"
alias to="tuist generate"
alias trg="tuist fetch && tuist generate -n && pod install && ow"
alias tg="tuist fetch && tuist generate -n && ow"
alias te="tuist edit"
alias edit="nvim"
alias e="nvim"
alias l="exa -las type"
alias lt="exa -las type"
alias ddc="sudo rm -rf ~/Library/Developer/Xcode/DerivedData"
alias gg="git log --oneline --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gds="git diff --staged"
alias gchrn="git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -n"
alias gll="git log -1 --stat --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias grs="git restore --staged ."
alias gr="git reset HEAD && git checkout ."
# alias gclp="cd $(pbpaste | xargs -I repo bash -c 'git clone repo && basename repo .git')" # Надо попробовать переписать
alias preview="fzf --preview 'bat --color \"always\" {}'"
alias sshkcopy="pbcopy < ~/.ssh/id_ed25519.pub"
alias pn="pnpm"
alias pnpx="pnpm dlx"
alias c="code ."
alias rlw="skhd --restart-service; yabai --restart-service; sudo yabai --load-sa; brew services restart borders; brew services restart sketchybar"
alias lzd="lazydocker"
#=======
# Notify
#=======
zstyle ':notify:*' success-title "Success!"
zstyle ':notify:*' error-title "Error!"
zstyle ':notify:*' error-icon "https://media3.giphy.com/media/10ECejNtM1GyRy/200_s.gif"
zstyle ':notify:*' success-icon "https://s-media-cache-ak0.pinimg.com/564x/b5/5a/18/b55a1805f5650495a74202279036ecd2.jpg"
#======
# To being able to move using shift and control
#======
setopt complete_aliases
bindkey '^[^[[D' backward-word
bindkey '^[^[[C' forward-word
bindkey '^[[5D' beginning-of-line
bindkey '^[[5C' end-of-line
bindkey '^[[3~' delete-char
bindkey '^?' backward-delete-char
#=======
# Fzf
#=======
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#=======
# Fasd
#=======
eval "$(fasd --init auto)"
#=======
# Other
#=======
export PATH=$HOME/bin:/usr/local/bin:$PATH
#=======
# libpq
#=======
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
#=======
# NVM
#=======
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
#=======
# RVM
#=======
#
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
#=======
# SDKMAN
#=======
#
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# pnpm
export PNPM_HOME="/Users/nugmanoff/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# pyenv end
# Herd injected PHP binary.
export PATH="/Users/nugmanoff/Library/Application Support/Herd/bin/":$PATH
# Herd injected PHP 8.2 configuration.
export HERD_PHP_82_INI_SCAN_DIR="/Users/nugmanoff/Library/Application Support/Herd/config/php/82/"
eval "$(/Users/nugmanoff/.local/bin/mise activate zsh)"
# ANDROID
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
# Ruby, CocoaPods
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
export PATH=$PATH:$HOME/.maestro/bin
# Herd injected PHP 8.3 configuration.
export HERD_PHP_83_INI_SCAN_DIR="/Users/nugmanoff/Library/Application Support/Herd/config/php/83/"