-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc.symlink
213 lines (170 loc) · 7.22 KB
/
zshrc.symlink
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
# Path to your oh-my-zsh installation.
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
export TERM="xterm-256color"
export DOTFILES=$HOME/.dotfiles
export ZSH=$DOTFILES/zsh/oh-my-zsh
autoload -U zmv
export DEFAULT_USER=$USER
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="spaceship"
ZSH_CUSTOM=$DOTFILES/zsh/custom
export REPORTTIME=10
# Theme options
# SPACESHIP_BATTERY_THRESHOLD=20
SPACESHIP_BATTERY_SHOW=false
SPACESHIP_PACKAGE_SHOW=false
#SPACESHIP_NODE_SHOW=false
#Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# User configuration
export ANDROID_HOME=/opt/android-sdk/
if type ruby > /dev/null; then
PATH=$PATH:"$(ruby -e 'print Gem.user_dir')/bin"
fi
[[ -d "/usr/lib/dart/bin/" ]] && PATH=$PATH:"/usr/lib/dart/bin/"
[[ -d "$HOME/.npm-packages/bin" ]] && PATH=$PATH:"$HOME/.npm-packages/bin"
[[ -d "$HOME/bin" ]] && PATH=$PATH:"$HOME/bin"
[[ -d "$HOME/go/bin" ]] && PATH=$PATH:"$HOME/go/bin"
[[ -d "$HOME/.deno/bin" ]] && PATH=$PATH:"$HOME/.deno/bin"
[[ -d "$HOME/.config/composer/vendor/bin" ]] && PATH=$PATH:"$HOME/.config/composer/vendor/bin"
[[ -d "$HOME/composer/vendor/bin" ]] && PATH=$PATH:"$HOME/composer/vendor/bin"
[[ -d "$ANDROID_HOME/tools" ]] && PATH=$PATH:"$ANDROID_HOME/tools"
[[ -d "$ANDROID_HOME/platform-tools/" ]] && PATH=$PATH:"$ANDROID_HOME/platform-tools/"
[[ -d "$HOME/.local/bin" ]] && PATH=$PATH:"$HOME/.local/bin"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
[[ -d "$HOME/.rvm/bin" ]] && PATH=$PATH:"$HOME/.rvm/bin"
[[ -d "$DOTFILES/bin" ]] && PATH=$PATH:"$DOTFILES/bin"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
vi-mode
colored-man-pages
git
laravel
npm
sudo
yarn
zsh-syntax-highlighting
zsh-autosuggestions
)
[[ -e $(which brew) ]] && plugins+=(osx)
[[ -e $(which git-flow) ]] && plugins+=(git-flow)
[[ -e $(which vagrant) ]] && plugins+=(vagrant)
[[ -e $(which composer) ]] && plugins+=(composer)
[[ -e $(which docker) ]] && plugins+=(docker)
[[ -e $(which docker-compose) ]] && plugins+=(docker-compose)
[[ -e $(which apt-get) ]] && plugins+=(ubuntu)
[[ -e $(which kubectl) ]] && plugins+=(kubectl)
[[ -e $(which helm) ]] && plugins+=(helm)
case "$OSTYPE" in
linux*)
alias open="xdg-open"
;;
esac
# export PATH=$PATH:"/usr/lib/dart/bin/:$HOME/.npm-packages/bin:$HOME/bin:$HOME/.config/composer/vendor/bin/:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools/:$HOME/.local/bin"
export IBUS_ENABLE_SYNC_MODE=1
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
export EDITOR='vim'
[[ -e $(which nvim) ]] && export EDITOR='nvim'
[[ -e $(which via-go) ]] && eval "$(via-go autocomplete)"
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias ll='ls -alh'
alias vi='vim'
alias gmm='git checkout master && git pull && git checkout - && git merge master'
alias lg='lazygit'
alias vg='via-go'
alias gpms='git push && git checkout stage && git pull && git merge - && git push'
# New Feature Branch
function nfb () {
git checkout master
git pull
git checkout -b feature/$1
}
# checkout by id
function gcoid () {
BRANCH_NAME=$(git branch -l | grep $1 | head -n 1 | cut -c3- | tr -d '\n')
if [ -z $BRANCH_NAME ]; then
echo "Could not find any Branch with this ID $1"
return
fi
git checkout "$BRANCH_NAME"
}
# enable vim mode
# bindkey -v
# override key bindings (emacs)
bindkey -e
bindkey -r "^[[5~"
bindkey -r "^[[6~"
bindkey "^u" backward-kill-line # opposite of ^k not killing entire line
bindkey -s "^[#" "^a#\n" # comment out line and go to next
bindkey "^[p" history-beginning-search-backward # alt+p
bindkey "^[n" history-beginning-search-forward # alt+n
bindkey "^[[5~" history-beginning-search-backward
bindkey "^[[6~" history-beginning-search-forward
# bindkey "${key[Up]}" up-line-or-history
# bindkey "${key[Down]}" down-line-or-history
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
### End: Fix slowness of pastes
# zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/my_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
# zstyle -e ':completion:*:(ssh|scp|sftp):*' hosts 'reply=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:# *}%%\ *}%%,*})'
zstyle -e ':completion:*:*:*' hosts 'reply=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:# *}%%\ *}%%,*})'
[[ -a "/etc/zsh_command_not_found" ]] && . /etc/zsh_command_not_found
[[ -e "$DOTFILES/zsh/custom/pluins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] && source $DOTFILES/zsh/custom/pluins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f ~/.deno.zsh ] && source ~/.deno.zsh
# init nvm
[ -f /usr/share/nvm/init-nvm.sh ] && source /usr/share/nvm/init-nvm.sh
#gmk autocompletion
[ -f ~/qmk_firmware/util/qmk_tab_complete.sh ] && source ~/qmk_firmware/util/qmk_tab_complete.sh
# z - jump around
[[ -r "/usr/share/z/z.sh" ]] && source /usr/share/z/z.sh
[[ -e $(which zoxide) ]] && eval "$(zoxide init --cmd cd zsh)"