forked from angelofallars/dotfiles-axyl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
241 lines (181 loc) · 5.61 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
241
# The following lines were added by compinstall
zstyle :compinstall filename '/home/angelo_f/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt beep extendedglob
unsetopt autocd nomatch notify
bindkey -v
# End of lines configured by zsh-newuser-install
# Color stuff
alias ls='exa -x --icons --git --group-directories-first'
alias la='exa -a -x --icons --git --group-directories-first'
alias cat='source-highlight --failsafe --out-format=esc -o STDOUT -i'
alias grep='grep --color=auto'
# Enabling and setting git info var to be used in prompt config.
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
# This line obtains information from the vcs.
zstyle ':vcs_info:git*' formats "%B%F{yellow}%b%f "
precmd() {
vcs_info
}
# Enable substitution in the prompt.
setopt prompt_subst
NEWLINE=$'\n'
prompt='%B%F{green}%~%f%b%F{green} ${vcs_info_msg_0_}%F{green}%f%b '
# Simplify XBPS commands
alias install="sudo xbps-install"
alias update="sudo xbps-install -Su"
alias query="xbps-query -Rs"
alias remove="sudo xbps-remove -R"
# Update the current zsh shell
alias srcsh="source ~/.zshrc"
# Convenient Git aliases
# gm - git commit
# gma - git commit -a
#alias gm="gitcut"
#alias gma="gitcut"
alias ga="git add"
alias gm="git commit"
alias gps="git push"
alias gpl="git pull"
alias gin="git init"
alias gcl="git clone"
alias grv="git remote -v"
alias gra="git remote add"
alias gs="git status"
alias gl="git log"
alias gd="git diff"
alias gds="git diff --staged"
alias grebase="git rebase"
alias gmerge="git merge"
alias ghelp="echo -n 'Git shortcuts:
ga - git add
gm - git commit
gps - git push
gpl - git pull
gin - git init
gcl - git clone
gra - git remote add
grv - git remote -v
gs - git status
gl - git log
gd - git diff
gd - git diff --staged
grebase - git rebase
gmerge - git merge
ghelp - show this help message
'"
alias v="nvim"
# Create virtual environment
pymake ()
{
python -m venv "${HOME}"/.venv/"$1"
}
# Delete virtual environment
pydel ()
{
echo "WARNING: You will permanently delete the Python virtual environment $1. Are you sure? (Y/N)"
read -r user_input
if [â ${user_input} = 'y' ]; then
rm "${HOME}"/.venv/"$1" -r
fi
}
# Activate virtual environment
pyon ()
{
source "${HOME}"/.venv/"$1"/bin/activate
}
alias venvon="source venv/bin/activate"
alias venvoff="deactivate"
# Deactivate virtual environment
alias pyoff="deactivate"
# Check list of virtual environments
pyls ()
{
echo "List of Python virtual environments:"
echo ${blue} > /dev/null
ls "${HOME}"/.venv
echo ${reset} > /dev/null
}
# Switch to international keyboard
intkey ()
{
setxkbmap -layout us -variant intl
xmodmap "${HOME}"/.config/i3/swapkeys -display :0
}
# Switch to regular keyboard
uskey ()
{
setxkbmap -layout us
xmodmap "${HOME}"/.config/i3/swapkeys -display :0
}
# Switch between US and International keyboards smartly
switchkey ()
{
current_key=$(cat "${HOME}"/.config/switchkey/current_key)
# To International keyboard layout
if [[ $current_key == "us" ]]; then
setxkbmap -layout us -variant intl
xmodmap "${HOME}"/.config/i3/swapkeys -display :0
echo "Switched to International keyboard. Hola mundo!"
echo "intl" > "${HOME}"/.config/switchkey/current_key
# To US keyboard layout
else
setxkbmap -layout us
xmodmap "${HOME}"/.config/i3/swapkeys -display :0
echo "Switched to US keyboard. Hello world!"
echo "us" > "${HOME}"/.config/switchkey/current_key
fi
}
# Edit my config files
edit () {
case $1 in
"zsh") nvim ~/.zshrc && \
source ~/.zshrc ;;
"tmux") nvim ~/.tmux.conf && \
tmux source-file ~/.tmux.conf ;;
"bspwm") nvim ~/.config/bspwm/bspwmrc && \
bspc wm -r ;;
"sxhkd") nvim ~/.config/sxhkd/sxhkdrc && \
pkill -USR1 -x sxhkd ;;
"polybar") nvim ~/.config/polybar/config && \
killall polybar && polybar mybar &;;
"neofetch") nvim ~/.config/neofetch/config.conf ;;
"neovim") nvim ~/.config/nvim/init.vim ;;
"nvim") nvim ~/.config/nvim/init.vim ;;
"alacritty") nvim ~/.config/alacritty/alacritty.yml ;;
"dunst") nvim ~/.config/dunst/dunstrc && \
killall dunst ;;
"picom") nvim ~/.config/picom/picom.conf ;;
"zathura") nvim ~/.config/zathura/zathurarc ;;
esac
}
# fun pipes on the terminal
alias pipes="pipes.sh -c 2 -c 3 -f 60 -r 800"
alias pipeswarm="pipes.sh -c 1 -c 3 -f 60 -r 800"
# cool matrix effect
alias cmatrix="cmatrix -C green -u 10"
# Switch key
alias swapctrl="xmodmap ~/.config/i3/swapkeys -display :0 &"
# Record video
alias rec="ffmpeg -video_size 1366x768 -framerate 30 -f x11grab -i :0.0 -pix_fmt yuv420p -c:v libx264 -preset ultrafast -y -v error -stats"
# autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
alias discord="discord --ignore-gpu-blocklist --disable-features=UseOzonePlatform --enable-features=VaapiVideoDecoder --use-gl=desktop --enable-gpu-rasterization --enable-zero-copy > /dev/null 2>&1 & disown"
export GIT_EDITOR="nvim"
export PATH=/home/angelo_f/.local/bin:$PATH
#. "$HOME/.cargo/env"
alias pd="pushd"
alias ppd="popd"
# Created by `pipx` on 2021-11-09 19:31:24
export PATH="$PATH:/home/angelo-f/.local/bin"
# source /home/angelo-f/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
export EXA_COLORS="di=32"
# A nice lil bonsai shell for Rust lovers.
treefetch --bonsai