-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
147 lines (126 loc) · 4.13 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
alias l="/usr/bin/eza -l --no-permissions --no-user --no-time -G"
alias ll="/usr/bin/eza -lH --git"
alias la="/usr/bin/eza -lHa --git"
alias l.="/usr/bin/eza -lHad .*"
# alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
# Enable sudo to work with alias commands
alias sudo="sudo "
alias grep="grep --color -P"
alias ag="ag --silent"
alias agg="ag -g"
alias rg="rg --no-messages"
alias du="/usr/bin/du -h"
alias df="/usr/bin/df -hT"
alias cls='/usr/bin/clear; echo -ne \\033c && bgcolor'
alias diff="/usr/bin/diff --color"
alias eu="TERM=xterm-256color emacs -nw"
alias eh="emacs -nw"
alias e="emacsclient -n -a ''"
alias s=subl
alias uhtop="htop -u $USER"
#alias nc="nc.openbsd"
alias hman="man -H"
alias f="find"
alias fdg="fd -g"
alias dmesg="dmesg -H"
alias up="uptime -p"
alias py="python3"
alias ip="ip -c"
alias jl="julia"
alias icat="kitty +kitten icat"
alias d="kitty +kitten diff"
# CDs
# alias ..="cd .." # not necessary in zsh
alias ...="cd ../.."
alias ....="cd ../../.."
alias aur="cd /mnt/baysea/AUR/"
alias shared="cd /run/media/prash/shared/"
alias redsea="cd /mnt/redsea/"
alias bluewest="cd /mnt/bluewest/"
alias fuji="cd /mnt/fuji320/"
alias baysea="cd /mnt/baysea/"
alias pd="pushd"
alias vd="popd"
# HID
alias lap-key-detach="xinput float 13"
alias lap-key-attach="xinput reattach 13 3"
# SSH
alias coli="ssh -XC [email protected]"
# Installers
if $(uname -a|grep -a "archlinux" >/dev/null )
then
alias pm="pacman"
alias pmq="pacman -Q"
alias pmqi="pacman -Qi"
alias pmql="pacman -Qql"
alias pmqo="pacman -Qqo"
if [[ -n $ZSH_NAME ]]; then
alias pmqoe="pacman -Qqo $(which $1)"
fi
alias pmqs="pacman -Qqs"
alias pmqtd="pacman -Qtd"
alias pmu="sudo pacman -U"
alias pms="sudo pacman -S"
alias pmsi="pacman -Si"
alias pmss="pacman -Ss"
alias pmr="sudo pacman -Rns"
alias pmsu="sudo pacman -Syu"
alias yaq="yay -Q"
alias yaqi="yay -Qi"
alias yaql="yay -Qql"
alias yaqo="yay -Qqo"
if [[ -n $ZSH_NAME ]]; then
alias yaqoe="yay -Qo $(which $1)"
fi
alias yaqs="yay -Qs"
alias yaqqs="yay -Qqs"
alias yaqtd="yay -Qtd"
alias yau="yay -U"
alias yas="yay -S"
alias yasi="yay -Si"
alias yass="yay -Ss"
alias yar="yay -Rns"
alias yan="yay -Sy && yay -Puw"
alias ygr="[ -d /mnt/baysea/var/cache/pacman/pkg ] && yay -Syu"
yag() { pushd /mnt/baysea/AUR/ && yay -G $1 && popd && cd /mnt/baysea/AUR/$1; }
fi
alias mkdir='mkdir -p'
alias yt='yt-dlp -o "%(title)s-%(id)s.%(ext)s" '
alias yti='yt-dlp --id '
alias get-idf='. $HOME/src/esp-idf/export.sh'
if [[ -n $ZSH_NAME ]]; then
# Suffixes
alias -s tar="tar xf"
alias -s tar.gz="tar xzf"
alias -s tgz="tar xzf"
alias -s tar.bz2="tar xjf"
alias -s tbz="tar xjf"
fi
alias doredsea="mount /mnt/redsea && df"
alias unredsea="umount /mnt/redsea && df"
alias doblacksea="mount /mnt/blacksea && df"
alias unblacksea="umount /mnt/blacksea && df"
alias dobluewest="mount /mnt/bluewest && df"
alias unbluewest="umount /mnt/bluewest && df"
man() {
LESS_TERMCAP_md=$(printf '\e[01;31m') \
LESS_TERMCAP_me=$(printf '\e[0m') \
LESS_TERMCAP_se=$(printf '\e[0m') \
LESS_TERMCAP_so=$(printf '\e[01;44;33m') \
LESS_TERMCAP_ue=$(printf '\e[0m') \
LESS_TERMCAP_us=$(printf '\e[01;32m') \
MANSECT="1,1p,l,8,3,3p,0,0p,2,5,4,9,6,7" command man "$@"
}
# ag wrapper that takes any number of words as arguments and searches for files that contain all of them
# Mostly created by ChatGPT!
function agn() {
words=("$@") # get the words passed as arguments
ag_cmd="ag -l '${words[0]}'" # start with the first word
for ((i=1; i<${#words[@]}; i++)); do
ag_cmd+=" | xargs ag -l '${words[i]}'" # pipe results to the next word search
done
ag_cmd+=" | xargs ag '${words[*]// /|}'" # search for lines that contain all words
eval "$ag_cmd" # execute the command
}