-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
172 lines (114 loc) · 3.78 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
# VPN
alias tor-on='networksetup -setsocksfirewallproxystate wi-fi on'
alias tor-off='networksetup -setsocksfirewallproxystate wi-fi off'
# alias dpi-on='networksetup -setwebproxystate wi-fi on'
# alias dpi-off='networksetup -setwebproxystate wi-fi off'
# npm
export NODE_NO_WARNINGS=1
# Recursome i have no idea stuff
setopt globstarshort
# GPG
GPG_TTY=$(tty)
export GPG_TTY
# Java
# export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
# export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"
# export JAVA_HOME="$(/usr/libexec/java_home)"
# Trivy
alias check-sec='docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image'
# Gradle
# export PATH="$PATH:/opt/gradle/gradle-8.7/bin"
# Homebrew
export PATH="/opt/homebrew/bin:$PATH"
export CPATH="/opt/homebrew/include"
export LIBRARY_PATH="/opt/homebrew/lib"
# ???
zle -N gitpull
bindkey '^gp' gitpull
# Git prompt
source ~/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# Pretty prompt
autoload -U colors && colors
setopt PROMPT_SUBST
PS1='%F{cyan}%13>~>%c%>>%f%B$(__git_ps1 " %s")%b $ '
# Git autocomplete
autoload -Uz compinit && compinit
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='fd --follow --hidden'
export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND
export FZF_DEFAULT_OPTS='--color=info:#5f5f5f,prompt:cyan,gutter:-1,pointer:cyan,bg+:-1,hl+:green'
# fzf-tab
autoload -U compinit; compinit
source ~/fzf-tab/fzf-tab.plugin.zsh
# fzf completion
source ~/fzf-tab-completion/zsh/fzf-zsh-completion.sh
# Vim moves
source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BLOCK
ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM
ZVM_MODE_VISUAL_CURSOR=$ZVM_CURSOR_BLINKING_UNDESCORE
ZVM_VI_INSERT_ESCAPE_BINDKEY=jj
# NeoVim aliases
alias vi='nvim'
alias vi\ .='nvim .'
alias vim='nvim'
alias vim\ .='nvim .'
# Git aliases
alias clone='git clone'
alias status='git status'
alias atree='git worktree add'
alias ltree='git worktree list'
alias rtree='git worktree remove'
alias newb='git checkout -b'
alias pull='git fetch && git pull origin'
alias push='git push -u origin HEAD'
alias hard='git fetch && git reset --hard origin'
alias switch='git switch'
alias fetch='ls | xargs -P10 -I{} git -C {} pull'
alias rebase='git merge -s ours'
alias fast-forward='git push -ff origin HEAD'
# Aspell aliases
alias check='aspell check'
# Misc. aliases
alias clean='cd && history -p && rm -f ~/.zsh_history && clear'
alias curl='curl -s -w "%{http_code}\n"'
alias ls='ls -F -a'
alias conf='nvim ~/.zshrc'
# alias subl.='subl .'
alias viconf='cd ~/.config/nvim && nvim . && cd -'
alias gitconf='nvim ~/.gitconfig'
alias ghosttyconf='nvim ~/.config/ghostty/config'
# alias tmuxconf='nvim ~/.config/tmux/.tmux.conf'
# Syntax highlighting
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Python 3 as default
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# LLVM
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
# tmux
# if [ "$TMUX" = "" ]; then tmux a || tmux new; fi
# eval "$(tmux source ~/.config/tmux/.tmux.conf)"
# zoxide
eval "$(zoxide init --cmd cd zsh)"
# iTerm
# test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# iterm2_print_user_vars() {
# iterm2_set_user_var gitBranch $((git branch 2> /dev/null) | grep \* | cut -c3-)
# }
# Go
export GOPATH=$HOME/go
export PATH="$HOME/go/bin:$PATH"
# bat
export BAT_THEME="Dracula"
alias cat='bat'
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# bun completions
[ -s "/Users/okamiraner/.bun/_bun" ] && source "/Users/okamiraner/.bun/_bun"