Reorganize aliases

This commit is contained in:
Rodolphe Bréard 2024-12-15 20:46:31 +01:00
parent e72fa461f7
commit bd6417336d
No known key found for this signature in database

View file

@ -1,32 +1,45 @@
#
# Aliases for ls
#
[ "$(uname -s | tr '[:upper:]' '[:lower:]')" = 'linux' ] && alias ls='ls --color=auto' [ "$(uname -s | tr '[:upper:]' '[:lower:]')" = 'linux' ] && alias ls='ls --color=auto'
alias ll='ls -lihF' alias ll='ls -lihF'
alias la='ls -A' alias la='ls -A'
alias l='ll -A' alias l='ll -A'
hash eza 2>/dev/null && alias ls='eza' 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 df='df -h'
alias grep='grep -n --color=auto'
alias ip='ip --color' alias ip='ip --color'
alias ipb='ip --color --brief' alias ipb='ip --color --brief'
alias j='jobs'
alias mount_ro='mount -o ro,noexec,noatime,nodev,nosuid,noiversion' alias mount_ro='mount -o ro,noexec,noatime,nodev,nosuid,noiversion'
hash tree 2>/dev/null && alias t='tree' alias sudo='sudo '
hash duf 2>/dev/null && alias du='duf'
hash htop 2>/dev/null && alias top='htop'
#
# 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 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 duf 2>/dev/null && alias du='duf'
hash sqlmap 2>/dev/null && alias sqlmap-tor='sqlmap --tor --tor-type=SOCKS5' 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 kitty 2>/dev/null && alias kitty_ssh='kitty +kitten ssh'
hash nvim 2>/dev/null && alias vim='nvim' 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" # More complex aliases
yay -S $(pacman -Qm | /bin/grep "$PATTERN" | cut -d ' ' -f1) #
}
fi
# https://github.com/OpenXRay/xray-16 # https://github.com/OpenXRay/xray-16
if hash xr_3da 2>/dev/null; then 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' alias stalker_call_of_pripyat='xr_3da'
fi 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 if hash yt-dlp 2>/dev/null; then
alias audio-dl='yt-dlp --extract-audio --audio-quality 0 --audio-format "vorbis"' alias audio-dl='yt-dlp --extract-audio --audio-quality 0 --audio-format "vorbis"'
alias youtube-dl='yt-dlp' alias youtube-dl='yt-dlp'