-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy path.zshrc_mine
206 lines (156 loc) · 6.19 KB
/
.zshrc_mine
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
# Personal Zsh configuration file. It is strongly recommended to keep all
# shell customization and configuration (including exported environment
# variables such as PATH) in this file or in files source by it.
#
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md.
# Periodic auto-update on Zsh startup: 'ask' or 'no'.
# You can manually run `z4h update` to update everything.
zstyle ':z4h:' auto-update 'no'
# Ask whether to auto-update this often; has no effect if auto-update is 'no'.
zstyle ':z4h:' auto-update-days '28'
# Start tmux if not already in tmux.
# zstyle ':z4h:' start-tmux command tmux -u new -A -D -t z4h
# Move prompt to the bottom when zsh starts and on Ctrl+L.
zstyle ':z4h:' prompt-at-bottom 'no'
# Keyboard type: 'mac' or 'pc'.
zstyle ':z4h:bindkey' keyboard 'pc'
# Right-arrow key accepts one character ('partial-accept') from
# command autosuggestions or the whole thing ('accept')?
zstyle ':z4h:autosuggestions' forward-char 'accept'
# Recursively traverse directories when TAB-completing files.
zstyle ':z4h:fzf-complete' recurse-dirs 'no'
# Enable direnv to automatically source .envrc files.
zstyle ':z4h:direnv' enable 'yes'
# Show "loading" and "unloading" notifications from direnv.
zstyle ':z4h:direnv:success' notify 'yes'
# Enable ('yes') or disable ('no') automatic teleportation of z4h over
# SSH when connecting to these hosts.
zstyle ':z4h:ssh:example-hostname1' enable 'yes'
zstyle ':z4h:ssh:*.example-hostname2' enable 'no'
# The default value if none of the overrides above match the hostname.
zstyle ':z4h:ssh:*' enable 'no'
# Send these files over to the remote host when connecting over SSH to the
# enabled hosts.
zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh'
# Clone additional Git repositories from GitHub.
#
# This doesn't do anything apart from cloning the repository and keeping it
# up-to-date. Cloned files can be used after `z4h init`. This is just an
# example. If you don't plan to use Oh My Zsh, delete this line.
z4h install ohmyzsh/ohmyzsh || return
# Install or update core components (fzf, zsh-autosuggestions, etc.) and
# initialize Zsh. After this point console I/O is unavailable until Zsh
# is fully initialized. Everything that requires user interaction or can
# perform network I/O must be done above. Everything else is best done below.
z4h init || return
# Extend PATH.
path=(~/bin $path)
# Export environment variables.
export GPG_TTY=$TTY
export SYS_LOCAL_BIN="/usr/local/bin"
export LOCAL_BIN="$HOME/.local/bin"
export GOROOT="/usr/lib/go"
export GOPATH="$HOME/go"
export GOBIN="$HOME/go/bin"
export HS_BIN="$HOME/.cabal/bin"
export NPM_BIN="$HOME/.npm-global/bin"
export KT_BIN="$HOME/.kotlin/bin"
export RS_BIN="$HOME/.cargo/bin"
export JAVA_HOME="/usr/lib/jvm/default"
export PATH=$SYS_LOCAL_BIN:$LOCAL_BIN:$GOBIN:$HS_BIN:$NPM_BIN:$RS_BIN:$JAVA_HOME:$PATH
export EDITOR="nvim"
export HTTP_PROXY="http://127.0.0.1:8889"
export HTTPS_PROXY="http://127.0.0.1:8889"
export ALL_PROXY="http://127.0.0.1:8889"
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
# Source additional local files if they exist.
z4h source ~/.env.zsh
# Use additional Git repositories pulled in with `z4h install`.
#
# This is just an example that you should delete. It does nothing useful.
z4h load ohmyzsh/ohmyzsh/plugins/extract # load a plugin
z4h load ohmyzsh/ohmyzsh/plugins/sudo # load a plugin
# Define key bindings.
z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
z4h bindkey undo Ctrl+/ Shift+Tab # undo the last command line change
z4h bindkey redo Alt+/ # redo the last undone command line change
z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory
z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory
z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory
z4h bindkey z4h-cd-down Alt+Down # cd into a child directory
# Autoload functions.
autoload -Uz zmv
# Define functions and completions.
# function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" }
# compdef _directories md
# Define named directories: ~w <=> Windows home directory on WSL.
[[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home
# Define aliases.
alias tree='tree -a -I .git'
alias vi="vim"
alias nv="nvim"
alias ne="neofetch"
alias vz="nvim ~/.zshrc"
alias sz="source ~/.zshrc"
alias ls="exa"
alias l.="exa -d .* --color=auto"
alias ll="exa -l --color=auto"
alias la="exa -a --color=auto"
alias jd="cd ~/Downloads"
alias jdc="cd ~/Downloads/Compressed"
alias jcl="cd ~/clone"
alias py="python3"
alias pyins="pip3 install --user"
alias pyuins="pip3 uninstall"
alias ins="paru -S"
alias uins="paru -R"
alias up="paru"
alias c="paru -c"
alias stlsa="sudo systemctl start"
alias stlst="sudo systemctl stop"
alias stlsu="sudo systemctl status"
alias stlen="sudo systemctl enable"
alias stldis="sudo systemctl disable"
alias stlre="sudo systemctl restart"
alias og="git-open"
alias gc="git clone"
alias ga="git add"
alias gm="git commit -m"
alias gps="git push"
alias dc="docker-compose"
alias dps="docker ps"
alias dst="docker stop"
alias dru="docker run"
alias drm="docker rm"
alias dls="docker images ls"
alias x="extract"
alias ne="neofetch"
alias uzw="unzip -O cp936"
alias ra="ranger"
alias d2u="find . -type f -exec dos2unix {} +"
alias del="sh ~/.rm.sh"
alias tra="cd ~/.local/share/Trash/files && ls -a"
alias cl="rm -rf ~/.local/share/Trash/files/*"
alias po="sudo poweroff"
alias reb="sudo reboot"
alias ssm="devour wezterm-gui ssh [email protected]:233"
alias sc="source ~/anaconda3/bin/activate"
alias cda="conda activate"
alias cdd="conda deactivate"
alias npmi="npm i"
alias npmig="npm i -g"
alias npmu="npm uninstall"
alias npmug="npm uninstall -g"
alias npmls="npm list"
alias npmaf="npm audit fix"
alias npmaff="npm audit fix --force"
alias npmrb="npm run build"
alias npmrt="npm run test"
alias md="devour typora"
# Add flags to existing aliases.
# alias ls="${aliases[ls]:-ls} -A"
# Set shell options: http://zsh.sourceforge.net/Doc/Release/Options.html.
setopt glob_dots # no special treatment for file names with a leading dot
setopt no_auto_menu # require an extra TAB press to open the completion menu
eval "$(zoxide init zsh)"