From e79e0989e6fe088cb4090213da3cb832c518eb67 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 14 Apr 2022 21:34:56 -0700 Subject: [PATCH] aliases: formatting, better `gs` alias, and bug fix with alias lsd --- .config/shell/aliases | 70 +++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/.config/shell/aliases b/.config/shell/aliases index ef32ac9..53f95f8 100644 --- a/.config/shell/aliases +++ b/.config/shell/aliases @@ -1,27 +1,28 @@ #!/bin/sh ## Short hand programs (ex: sc = shellcheck) >>> # use nvim rather than vim if the command exists -alias \ - vim='nvim' \ - vimdiff='nvim -d' +alias \ + vim='nvim' \ + vimdiff='nvim -d' \ -alias \ - vv='$EDITOR' \ - e='$EDITOR' \ +alias \ + vv='$EDITOR' \ + e='$EDITOR' \ sedit='sudoedit' \ # I do this too much by accident smh my head -alias :q='exit' \ - q='exit' \ +alias \ + :q='exit' \ + q='exit' \ # rmdir is long -alias \ +alias \ rmd='rmdir' \ - rd='rmdir' \ + rd='rmdir' \ -alias \ - mkd="mkdir -p" \ - g=git \ +alias \ + mkd="mkdir -p" \ + g=git \ sctl='sudo systemctl' \ # <<< @@ -33,14 +34,14 @@ alias bc='bc -ql' # Make bc usable for fast math [ -z "$VIMRUNTIME" ] && alias glow='glow -p' # force Glow to preview with `less` if not in vim -# I hate it when I get ghost script instead of git status. this will be removed -alias gs="echo 'you don'\''t really want ghost script, do you?'" +# I hate it when I get ghost script instead of git status +alias gs='echo "you don'\''t $(tput sitm)really$(tput sgr0) want ghost script now, do you?"' # tell make to use all cpu cores alias make='make -j$(nproc)' # Colors -alias \ +alias \ ls='ls -hN --color=auto --group-directories-first' \ grep='grep --color=auto' \ egrep='egrep --color=auto' \ @@ -50,12 +51,12 @@ alias \ # super duper paru alias # shellcheck disable=SC2139 -alias \ +alias \ parue="$(which paru) --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --fm nvim" \ - paru='parue --skipreview' + paru='parue --skipreview' \ if command -v lsd > /dev/null; then - $IS_TTY && alias ls=lsd + ! $IS_TTY && alias ls=lsd alias lsd='lsd --group-dirs=first' fi # <<< @@ -80,22 +81,25 @@ alias ydotool='(sudo ydotoold &) && sleep 0.05 && sudo ydotool' alias zup='zinit self-update && zinit update --parallel' # Edit config files -alias \ +alias \ nvc='(cd ~/.config/nvim/lua/blake && nvim ../../init.lua)' \ - zc='$EDITOR ~/.zshrc' \ - sc='$EDITOR $SHELL_CONFIG_DIR/shrc' \ - fstab='sudoedit /etc/fstab' \ - hst='$EDITOR $HISTFILE' \ + zc='$EDITOR ~/.zshrc' \ + sc='$EDITOR $SHELL_CONFIG_DIR/shrc' \ + fstab='sudoedit /etc/fstab' \ + histe='$EDITOR $HISTFILE' \ + +# Get me to my code faster +[ -n "$C" ] && alias cdc='cd "$C" && source ../bin/utils.bashrc' # Git cLONE alias glone="git clone" # Docker -alias \ - logs='docker-compose logs --tail=200 -f' \ - dupd='docker-compose up -d' \ - ddwn='docker-compose down' \ - dc='docker-compose' \ +alias \ + logs='docker-compose logs --tail=200 -f' \ + dupd='docker-compose up -d' \ + ddwn='docker-compose down' \ + dc='docker-compose' \ occ='docker exec -u www-data nextcloud php occ' \ # file copying with a progress bar @@ -122,10 +126,10 @@ SMART_PLUG_IP='192.168.1.250' alias light='tplink_smartplug.py -t $SMART_PLUG_IP -c' # Common ls aliases -alias \ - l='ls' \ - la='ls -ah' \ - ll='ls -lh' \ +alias \ + l='ls' \ + la='ls -ah' \ + ll='ls -lh' \ lla='ls -lah' \ # <<<