-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
219 lines (188 loc) · 6.1 KB
/
dot_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
export PATH=$HOME/bin:/usr/local/bin:$PATH
unsetopt BASH_AUTO_LIST
export ZSH_DISABLE_COMPFIX="true"
export ZSH="/home/daniel/.oh-my-zsh"
source ~/.zplug/init.zsh
plugins=(git)
source $ZSH/oh-my-zsh.sh
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
PATH=/home/daniel/.local/share/umake/bin:$PATH
export PATH="$HOME/.poetry/bin:$HOME/.cargo/bin:$PATH"
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
alias zshconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
function powerline_precmd() {
PS1="$(powerline-shell --shell zsh $?)"
}
function install_powerline_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
if [ "$TERM" != "linux" ]; then
install_powerline_precmd
fi
export VAGRANT_DEFAULT_PROVIDER="libvirt"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export MANROFFOPT="-c"
function atoi
{
#Returns the integer representation of an IP arg, passed in ascii dotted-decimal notation (x.x.x.x)
IP=$1; IPNUM=0
for (( i=0 ; i<4 ; ++i )); do
((IPNUM+=${IP%%.*}*$((256**$((3-${i}))))))
IP=${IP#*.}
done
echo $IPNUM
}
function itoa
{
#returns the dotted-decimal ascii form of an IP arg passed in integer format
echo -n $(($(($(($((${1}/256))/256))/256))%256)).
echo -n $(($(($((${1}/256))/256))%256)).
echo -n $(($((${1}/256))%256)).
echo $((${1}%256))
}
function mkcd {
mkdir "$1"
cd "$1"
}
eval $(thefuck --alias)
# You can use whatever you want as an alias, like for Mondays:
eval $(thefuck --alias FUCK)
export PATH="/home/daniel/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
### Install rbenv
#if [ ! -d "$HOME/.rbenv" ]
#then
# git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
#fi
#if [ -d "$HOME/.rbenv" ] && [ ! -d "$HOME/.rbenv/plugins/ruby-build" ]
#then
# git clone https://github.com/sstephenson/ruby-build.git \
# $HOME/.rbenv/plugins/ruby-build
#fi
## initialize rbenv
#if [ -d $HOME/.rbenv ]
#then
# export RBENV_ROOT="$HOME/.rbenv"
# export PATH="$RBENV_ROOT/bin:$PATH"
# if type "rbenv" &> /dev/null; then
# eval "$(rbenv init -)"
# # Add the version to my prompt
# __rbversion (){
# if type "ruby" &> /dev/null; then
# rbenv_ruby_version=$(rbenv version | sed -e 's/ .*//')
# printf $rbenv_ruby_version
# fi
# }
# export PS1="rb:\$(__rbversion)|$PS1"
# fi
#fi
fpath=($fpath ~/.zsh/completion)
export PATH="/home/daniel/.local/git-fuzzy/bin:$PATH"
export PATH="/home/daniel/go/bin:$PATH"
fpath+=~/.zfunc
alias ssh="ssh -q"
alias git=hub
alias i="sudo dnf install -y"
alias r="sudo dnf remove -y"
alias up="sudo dnf update -y --refresh"
alias n=nvim
alias blue="sudo service bluetooth restart"
alias sl="ls"
alias t="tmux"
alias note="notes"
alias q="exit"
alias kali="ssh kali"
alias who="whois"
alias sn="sudo nvim"
alias dockerclean='docker rm $(docker ps -a -q)'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerpurge='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
alias virsh='sudo virsh'
alias c="clear"
alias glog="git log --graph --decorate --pretty=oneline --abbrev-commit"
alias cp='rsync -aP'
alias back="cd -"
alias cat="bat --style='grid,changes,header,numbers' --map-syntax conf:toml"
alias ls="exa"
alias vim="nvim"
alias vi="nvim"
alias ipy="ipython --no-banner"
alias mobsf="docker run -it --name mobsf -p 8000:8000 -v /home/daniel/mobsf:/root/.MobSF opensecurity/mobile-security-framework-mobsf:latest"
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zplug/zplug"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "plugins/colored-man-paged", from:oh-my-zsh
zplug "plugins/colorize", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/copydir", from:oh-my-zsh
zplug "plugins/copyfile", from:oh-my-zsh
zplug "plugins/dircycle", from:oh-my-zsh
zplug "plugins/extract", from:oh-my-zsh
zplug "plugins/history", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/golang", from:oh-my-zsh
zplug "plugins/pip", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/aws", from:oh-my-zsh
zplug "plugins/debian", from:oh-my-zsh
zplug "plugins/dirhistory", from:oh-my-zsh
zplug "plugins/npm", from:oh-my-zsh
zplug "plugins/python", from:oh-my-zsh
zplug "plugins/pyenv", from:oh-my-zsh
zplug "plugins/svn", from:oh-my-zsh
zplug "plugins/tmux", from:oh-my-zsh
zplug "plugins/vscode", from:oh-my-zsh
zplug "plugins/zsh", from:oh-my-zsh
zplug "plugins/dnf", from:oh-my-zsh
zplug "b4b4r07/enhancd", use:enhancd.sh
#zplug "plugins/rbenv", from:oh-my-zsh
zplug "supercrabtree/k"
zplug "hlissner/zsh-autopair", defer:2
zplug "felixr/docker-zsh-completion"
zplug "tarrasch/zsh-bd"
zplug "srijanshetty/zsh-pip-completion"
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh
if [ -r ~/.zshrc_work ]; then
source ~/.zshrc_work
fi
# Install plugins if there are plugins that have not been installed
if ! zplug check; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
# Then, source plugins and add commands to $PATH
zplug load
HISTFILE=~/.zsh_history
HISTSIZE=100000
SAVEHIST=100000
setopt append_history # Dont overwrite history
setopt extended_history # Also record time and duration of commands.
setopt share_history # Share history between multiple shells
setopt hist_expire_dups_first # Clear duplicates when trimming internal hist.
setopt hist_find_no_dups # Don't display duplicates during searches.
setopt hist_ignore_dups # Ignore consecutive duplicates.
setopt hist_ignore_all_dups # Remember only one unique copy of the command.
setopt hist_reduce_blanks # Remove superfluous blanks.
setopt hist_save_no_dups # Omit older commands in favor of newer ones.
setopt pushd_ignore_dups # Dont push copies of the same dir on stack.
setopt pushd_minus # Reference stack entries with "-".