[F] Fix order

This commit is contained in:
2025-08-03 09:10:53 -04:00
committed by GitHub
parent d688983c82
commit baa3638dcf
+33 -33
View File
@@ -16,39 +16,6 @@ select-word-style bash
bindkey '^W' backward-delete-word
bindkey '^H' backward-kill-word
# Modern unix replacements.
# Usage: modern-replace 'orig cmd' 'new cmd' 'orig cmd with args (optional)' 'new cmd with args (optional)'
modern-replace() {
orig_cmd="$1"
new_cmd="$2"
orig_cmd_with_args="${3:-$1}"
new_cmd_with_args="${4:-$2}"
if command -v "$new_cmd" &> /dev/null; then
alias "$orig_cmd=$new_cmd_with_args"
else
alias "$orig_cmd=$orig_cmd_with_args"
fi
}
modern-replace 'ls' 'eza' 'ls -h --color=auto'
modern-replace 'df' 'duf' 'df -h'
modern-replace 'cat' 'bat'
modern-replace 'man' 'tldr'
modern-replace 'top' 'btop'
modern-replace 'ping' 'gping'
modern-replace 'dig' 'dog'
modern-replace 'grep' 'rg'
modern-replace 'nano' 'micro'
modern-replace 'curl' 'curlie'
# modern-replace 'tree' 'broot'
modern-replace 'pacman' 'paru' 'pacman --color always' 'paru --color always'
modern-replace 'vi' 'nvim'
modern-replace 'vim' 'nvim'
# for macOS
modern-replace 'tar' 'gtar'
source "$BASEDIR/plugins/zsh-z.plugin.zsh"
# Initialize fuck
@@ -301,6 +268,39 @@ alias colors="color '&000&111&222&333&444&555&666&777&888&999&aaa&bbb&ccc&ddd&ee
for f in "$SCR/includes/"*.*sh; do source "$f"; done
for f in "$SCR/includes/later/"*.*sh; do source "$f"; done
# Modern unix replacements.
# Usage: modern-replace 'orig cmd' 'new cmd' 'orig cmd with args (optional)' 'new cmd with args (optional)'
modern-replace() {
orig_cmd="$1"
new_cmd="$2"
orig_cmd_with_args="${3:-$1}"
new_cmd_with_args="${4:-$2}"
if command -v "$new_cmd" &> /dev/null; then
alias "$orig_cmd=$new_cmd_with_args"
else
alias "$orig_cmd=$orig_cmd_with_args"
fi
}
modern-replace 'ls' 'eza' 'ls -h --color=auto'
modern-replace 'df' 'duf' 'df -h'
modern-replace 'cat' 'bat'
modern-replace 'man' 'tldr'
modern-replace 'top' 'btop'
modern-replace 'ping' 'gping'
modern-replace 'dig' 'dog'
modern-replace 'grep' 'rg'
modern-replace 'nano' 'micro'
modern-replace 'curl' 'curlie'
# modern-replace 'tree' 'broot'
modern-replace 'pacman' 'paru' 'pacman --color always' 'paru --color always'
modern-replace 'vi' 'nvim'
modern-replace 'vim' 'nvim'
# for macOS
modern-replace 'tar' 'gtar'
# Set proxy
setproxy() {
addr=${1:-127.0.0.1}