-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.aliases
357 lines (310 loc) · 10.7 KB
/
.aliases
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# .aliases
# created by Nick Garcia
# https://github.com/NicksIdeaEngine/dotfiles
# {{{ table of contents
# 0. globals
# 1. navigation
# 2. config files
# 3. todotxt cli
# 4. useful replacements
# 5. git
# 6. npm / yarn
# y. system aliases
# z. overflow
# }}}
# {{{ 0. globals
dbx="/mnt/sdc1/dbx"
alias sudo="sudo "
alias {v,vi,vim}="nvim"
# }}}
# {{{ 1. navigation
# move to certain folders
alias navls="echo 'dbx cfg cod doc dot dwn mzk pix prj pfl \
\nref scr tmp vds wrt cpy userchrome[dev]'" \
dbx="cd $dbx" \
cfg="cd ~/.config" \
cod="cd ~/code" \
doc="cd ~/docs" \
dot="cd ~/dots" \
dwn="cd ~/dwn" \
mzk="cd ~/music" \
pix="cd ~/pics" \
prj="cd ~/proj" \
pfl="cd ~/proj/nickgarcia" \
ref="cd ~/refs" \
scr="cd ~/scripts" \
tmp="cd ~/tmp" \
vds="cd ~/vids" \
wrt="cd ~/writing" \
cpy="cd ~/writing/copywriting" \
userchrome="cd ~/.mozilla/firefox/65rf3aso.default-release/chrome" \
userchromedev="cd ~/.mozilla/firefox/ad1fuz9r.dev-edition-default/chrome"
# sped up cd navigation
alias cd.="cd .." \
cd..="cd .." \
{..,.1}="cd .." \
{...,.2}="cd ../.." \
{....,.3}="cd ../../.." \
{.....,.4}="cd ../../../.."
# }}}
# {{{ 2. config files
# open quantify workspace
# alias quantify="code $dbx/quant/quant.code-workspace"
# config editing binds
alias cfls="echo 'Alias Bashrc[L,P] Compton Dunst Firefox FirefoxDev I3wm \
\nKitty Mpd Nvim Polybar PRofile Ranger RescueTime St Tmux \
\nVim Xresources Ytdl[S,V] Zshrc[E,P]'" \
cfa="vim ~/.aliases" \
cfb="vim ~/.bashrc" \
cfbl="vim ~/.bash_logout" \
cfbp="vim ~/.bash_profile" \
cfc="vim ~/.config/compton.conf" \
cfd="vim ~/.config/dunst/dunstrc" \
cff="vim ~/.mozilla/firefox/65rf3aso.default-release/chrome/userChrome.css" \
cffd="vim ~/.mozilla/firefox/ad1fuz9r.dev-edition-default/chrome/userChrome.css" \
cfi="vim ~/.config/i3/config" \
cfk="vim ~/.config/kitty/kitty.conf" \
cfm="vim ~/.config/mpd/mpd.conf" \
cfn="vim ~/.config/nvim/init.vim" \
cfp="vim ~/.config/polybar/config.ini" \
cfpr="vim ~/.profile" \
cfr="vim ~/.config/ranger/rc.conf" \
cfrt="vim ~/.config/rescuetime/.rtgoals" \
cfs="vim ~/.local/st/config.h" \
cft="vim ~/.tmux.conf" \
cfv="vim ~/.vimrc" \
cfx="vim ~/.Xresources" \
cfys="vim ~/.config/youtube-dl/songconfig" \
cfyv="vim ~/.config/youtube-dl/vidconfig" \
cfz="vim ~/.zshrc" \
cfze="vim ~/.zshenv" \
cfzp="vim ~/.zprofile"
# recompile st terminal
alias instst="cd ~/.local/st && sudo make install && alert 'st has been rebuilt'"
# }}}
# {{{ 3. todotxt cli
# todo.txt aliases
alias _t="todo.sh -c -t -d ~/.config/todo/config" \
tls="echo 'todo: open todo.txt | t: show tasks by project | tg: graph \
\ntfg: config | tm: many | ta: wp add | tap: append | tdu: due \
\ntpp: prep | tp: pri | tv: view | tvp: view project | tdo: do'" \
todo="vim $HOME/todo/todo.txt" \
tpr="clear;todo.sh -c -t -d ~/.config/todo/config" \
tg="clear;todo.sh graph 30" \
tgr="clear;todo.sh graph" \
tgw="clear;todo.sh graph 7" \
tfg="vim ~/.config/todo/config" \
tfgalloc="vim ~/.config/todo/.actions.d/wp/allocations.conf" \
tm="_t many" \
ta="_t wp add" \
tap="todo.sh app" \
tdp="todo.sh depri" \
tdu="clear;todo.sh due" \
tpp="todo.sh prep" \
tp="todo.sh pri" \
trp="_t replace" \
tv="clear;todo.sh view" \
tvc="clear;todo.sh view context" \
tvp="clear;todo.sh view project" \
tdo="todo.sh again" \
tch="todo.sh chcon" \
talloc="todo.sh wp alloc" \
twl="todo.sh wp ls" \
tdn="todo.sh donow" \
tws="todo.sh wp summary" \
twg="todo.sh wp graph" \
tdump="vim $HOME/todo/dump.txt"
# }}}
# {{{ 4. useful replacements
# helpful reference for creating sym links
alias lnls="echo 'ln -s <file to be linked> <location of the link>'" \
c="clear" \
h="history" \
how="function hdi(){ howdoi $* -c -n 5; }; hdi" \
gcal="gcalcli" \
:q="exit" \
{md,mkdir}="mkdir -pv" \
{rd,rmdir}="rmdir -v" \
sym="$HOME/scripts/symswitch.sh" \
updatr="$HOME/scripts/updatr.sh" \
sshrestart="sudo systemctl restart ssh.service"
# pacman shortcuts
alias pmss="pacman -Ss" \
pmqs="pacman -Qs" \
pmsyu="sudo pacman -Syu" \
pmrsu="sudo pacman -Rsu"
# ask when deleting multiple
alias rm="rm -I" \
rmf="rm -Irvf"
# some more ls aliases
alias ll="ls -halF" \
la="ls -A" \
l="ls -hlF" \
lsa="ls -lah" \
lsd="ls -lF | grep '^d'" \
lr="ls -tRFh" \
ldot="ls -ld .*" \
lS="ls -1FSsh"
# leave ranger and enter that directory in terminal
alias ranger="source ranger" \
rn="source ranger"
# use i3lock when afk
alias afk="i3lock -ti /mnt/sdc1/Dropbox/pics/wallpaper/wall509.png"
alias tosort="vlc /home/efex/music/to-sort/*"
alias grablist="youtube-dl --config-location ~/.config/youtube-dl/songconfig \"https://www.youtube.com/playlist?list=PLedhaNZS3z5JfQ8lQIY3Drq3bvNX2TKSP\" && alert 'grablist complete'"
# alias grabsong="youtube-dl --config-location ~/.config/youtube-dl/songconfig \"https://\" && alert 'grabsong complete'"
alias grabsong="youtube-dl --config-location ~/.config/youtube-dl/songconfig"
# alias grabvid="youtube-dl --config-location ~/.config/youtube-dl/vidconfig \"https://\" && alert 'grabvid complete'"
alias grabvid="youtube-dl --config-location ~/.config/youtube-dl/vidconfig"
# clear youtube-dl cache
alias ytdlcache="youtube-dl --rm-cache-dir && alert 'youtube-dl cache removed!'"
# restart redshift with config
alias rered="redshift -c /home/efex/.config/redshift.conf &!"
# }}}
# {{{ 5. git
alias ga="git add" \
gcm="git commit -m" \
gacm="git add . && git commit -m" \
gph="git push origin master" \
gpl="git pull origin master" \
gplr="git pull --rebase origin" \
gst="git status" \
gfa="git fetch --all"
# }}}
# {{{ 6. npm / yarn
alias nis="npm install --save" \
nid="npm install --save-dev" \
nrd="npm run devserver" \
ndv="npm run develop" \
nst="npm start" \
nbd="npm run build" \
nsr="npm run serve" \
ncl="npm run clean" \
nup="npm update" \
naf="npm audit fix"
alias yi="yarn install" \
ya="yarn add" \
yad="yarn add --dev" \
yga="yarn global add" \
yr="yarn run" \
yre="yarn run example" \
ys="yarn start" \
yis="yarn install && yarn start" \
yt="yarn test" \
yit="yarn install && yarn test" \
yrv="yarn remove"
# }}}
# {{{ y. system aliases
# Add an "alert" alias for long running commands. Use like so:
alias alert='notify-send --urgency=normal '
alias alow='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias anorm='notify-send --urgency=normal -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias acrit='notify-send --urgency=critical -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# refresh .zshrc file
alias fresh="source ~/.zshrc;clear"
# system tools
alias cachecheck="du -sh /home/efex/.cache/thumbnails/"
alias cacheclean="rm -rf /home/efex/.cache/thumbnails/* && alert 'cacheclean is complete!'"
alias snupdate="sudo snap refresh"
alias snapcheck="du -h /var/lib/snapd/snaps"
alias snapclean="sudo $HOME/scripts/snapclean.sh && alert 'snapclean is complete!'"
# pip and pip3 updaters
alias pipupdate="pip freeze --local | sed -rn 's/^([^=# \t\\][^ \t=]*)=.*/echo; echo Processing \1 ...; pip install -U \1/p' | sh"
alias pip3update="pip3 freeze --local | sed -rn 's/^([^=# \t\\][^ \t=]*)=.*/echo; echo Processing \1 ...; pip3 install -U \1/p' | sh"
# .Xresources handling - reload, merge
#alias xm="xrdb -merge ~/.Xresources"
#alias xr="xrdb ~/.Xresources"
# Set default sink
alias speakers="pactl set-default-sink alsa_output.pci-0000_0a_00.3.analog-stereo"
alias headphones="pactl set-default-sink alsa_output.usb-Logitech_Logitech_G430_Gaming_Headset-00.analog-stereo"
# }}}
# {{{ z. overflow
# get week number
# alias week="date +%V"
# Example aliases
# alias lart="ls -1Fcart"
# alias lrt="ls -1Fcrt"
# alias h="history"
# alias p="(processes for current user)"
# alias H="| head"
# alias T="| tail"
# alias G="| grep"
# alias L="| less"
# alias M="| most"
# alias LL="2>&1 | less"
# alias CA="2>&1 | cat -A"
# alias NE="2> /dev/null"
# alias NUL="> /dev/null 2>&1"
# alias P="2>&1| pygmentize -l pytb"
# Git Aliases
# alias gs='git status'
# alias gstsh='git stash'
# alias gst='git stash'
# alias gsp='git stash pop'
# alias gsa='git stash apply'
# alias gsh='git show'
# alias gshw='git show'
# alias gshow='git show'
# alias gi='vim .gitignore'
# alias gcm='git ci -m'
# alias gcim='git ci -m'
# alias gci='git ci'
# alias gco='git co'
# alias gcp='git cp'
# alias ga='git add -A'
# alias gap='git add -p'
# alias guns='git unstage'
# alias gunc='git uncommit'
# alias gm='git merge'
# alias gms='git merge --squash'
# alias gam='git amend --reset-author'
# alias grv='git remote -v'
# alias grr='git remote rm'
# alias grad='git remote add'
# alias gr='git rebase'
# alias gra='git rebase --abort'
# alias ggrc='git rebase --continue'
# alias gbi='git rebase --interactive'
# alias gl='git l'
# alias glg='git l'
# alias glog='git l'
# alias co='git co'
# alias gf='git fetch'
# alias gfp='git fetch --prune'
# alias gfa='git fetch --all'
# alias gfap='git fetch --all --prune'
# alias gfch='git fetch'
# alias gd='git diff'
# alias gb='git b'
# # Staged and cached are the same thing
# alias gdc='git diff --cached -w'
# alias gds='git diff --staged -w'
# alias gpub='grb publish'
# alias gtr='grb track'
# alias gpl='git pull'
# alias gplr='git pull --rebase'
# alias gps='git push'
# alias gpsh='git push -u origin `git rev-parse --abbrev-ref HEAD`'
# alias gnb='git nb' # new branch aka checkout -b
# alias grs='git reset'
# alias grsh='git reset --hard'
# alias gcln='git clean'
# alias gclndf='git clean -df'
# alias gclndfx='git clean -dfx'
# alias gsm='git submodule'
# alias gsmi='git submodule init'
# alias gsmu='git submodule update'
# alias gt='git t'
# alias gbg='git bisect good'
# alias gbb='git bisect bad'
# alias gdmb='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
# # Common shell functions
# alias less='less -r'
# alias tf='tail -f'
# alias l='less'
# alias lh='ls -alt | head' # see the last modified files
# alias screen='TERM=screen screen'
# alias cl='clear'
# # Zippin
# alias gz='tar -zcvf'
# }}}