From baa3638dcf5b836f07e7fd07f3862ef26f91d7b5 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 3 Aug 2025 09:10:53 -0400 Subject: [PATCH] [F] Fix order --- scripts/zshrc.sh | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/scripts/zshrc.sh b/scripts/zshrc.sh index 608dec5..ac4ff86 100755 --- a/scripts/zshrc.sh +++ b/scripts/zshrc.sh @@ -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}