From bd6417336d664df665d54733043fa6e09dc2456b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 15 Dec 2024 20:46:31 +0100 Subject: [PATCH] Reorganize aliases --- .config/rodolphe/.aliases | 50 +++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.config/rodolphe/.aliases b/.config/rodolphe/.aliases index 34fd742..a0cfcb2 100644 --- a/.config/rodolphe/.aliases +++ b/.config/rodolphe/.aliases @@ -1,32 +1,45 @@ +# +# Aliases for ls +# + [ "$(uname -s | tr '[:upper:]' '[:lower:]')" = 'linux' ] && alias ls='ls --color=auto' alias ll='ls -lihF' alias la='ls -A' alias l='ll -A' hash eza 2>/dev/null && alias ls='eza' -alias sudo='sudo ' -alias grep='grep -n --color=auto' -alias j='jobs' + +# +# Aliases for common commands +# + alias df='df -h' +alias grep='grep -n --color=auto' alias ip='ip --color' alias ipb='ip --color --brief' +alias j='jobs' alias mount_ro='mount -o ro,noexec,noatime,nodev,nosuid,noiversion' -hash tree 2>/dev/null && alias t='tree' -hash duf 2>/dev/null && alias du='duf' -hash htop 2>/dev/null && alias top='htop' +alias sudo='sudo ' + + +# +# Aliases for installed programs +# + hash clang-format 2>/dev/null && alias clang-format='clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, AllowShortFunctionsOnASingleLine: None, KeepEmptyLinesAtTheStartOfBlocks: false}"' -hash sqlmap 2>/dev/null && alias sqlmap='sqlmap --user-agent="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"' -hash sqlmap 2>/dev/null && alias sqlmap-tor='sqlmap --tor --tor-type=SOCKS5' +hash duf 2>/dev/null && alias du='duf' +hash helix 2>/dev/null && alias hx='helix' +hash htop 2>/dev/null && alias top='htop' hash kitty 2>/dev/null && alias kitty_ssh='kitty +kitten ssh' hash nvim 2>/dev/null && alias vim='nvim' -hash helix 2>/dev/null && alias hx='helix' +hash sqlmap 2>/dev/null && alias sqlmap='sqlmap --user-agent="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"' +hash sqlmap 2>/dev/null && alias sqlmap-tor='sqlmap --tor --tor-type=SOCKS5' +hash tree 2>/dev/null && alias t='tree' -if hash yay 2>/dev/null; then - reinstall_pattern() { - PATTERN="$1" - yay -S $(pacman -Qm | /bin/grep "$PATTERN" | cut -d ' ' -f1) - } -fi + +# +# More complex aliases +# # https://github.com/OpenXRay/xray-16 if hash xr_3da 2>/dev/null; then @@ -35,6 +48,13 @@ if hash xr_3da 2>/dev/null; then alias stalker_call_of_pripyat='xr_3da' fi +if hash yay 2>/dev/null; then + reinstall_pattern() { + PATTERN="$1" + yay -S $(pacman -Qm | /bin/grep "$PATTERN" | cut -d ' ' -f1) + } +fi + if hash yt-dlp 2>/dev/null; then alias audio-dl='yt-dlp --extract-audio --audio-quality 0 --audio-format "vorbis"' alias youtube-dl='yt-dlp'