diff options
author | awy <awy@awy.one> | 2025-07-29 03:42:18 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-07-29 03:42:18 +0300 |
commit | ef6dff4cce15186a66ba34cdd7bd39958ebf7f58 (patch) | |
tree | fcfa61164ca6e79c900b5d11f6afc6b46aaccb84 /.config/shell/aliasrc | |
download | hyprdots-ef6dff4cce15186a66ba34cdd7bd39958ebf7f58.tar.gz |
first commit
Diffstat (limited to '.config/shell/aliasrc')
-rw-r--r-- | .config/shell/aliasrc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..f875a05 --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,75 @@ +#!/bin/sh + +# Use neovim for vim if present. +[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" + +[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" + +# doas not required for some system commands +for command in mount umount dinitctl pacman updatedb su shutdown poweroff reboot ; do + alias $command="doas $command" +done; unset command + +se() { + choice="$(fd . --base-directory=$HOME/.local/bin -t f --min-depth=1 | fzf)" + [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" +} + +# Verbosity and settings that you pretty much just always are going to want. +alias \ + cp="cp -iv" \ + mv="mv -iv" \ + rm="rm -vI" \ + bc="bc -ql" \ + rsync="rsync -vrPlu" \ + mkd="mkdir -pv" \ + yt="yt-dlp --embed-metadata -i" \ + yta="yt -x -f bestaudio/best" \ + ytt="yt --skip-download --write-thumbnail" \ + ffmpeg="ffmpeg -hide_banner" + +# Colorize commands when possible. +alias \ + ll="eza -lh --group-directories-first --color=auto --color-scale=all --color-scale-mode=fixed --icons --no-quotes --smart-group -s size --total-size --no-user --no-permissions" \ + ls="eza --group-directories-first --color=auto --icons --no-quotes -s name" \ + lsf="eza -f --group-directories-first --color=auto --icons --no-quotes -s name" \ + lsd="eza -D --group-directories-first --color=auto --icons --no-quotes -s name" \ + lst="eza -lh --group-directories-first --color=auto --color-scale --icons --no-quotes --smart-group -s time --total-size --no-user --no-permissions" \ + cat="bat -P" \ + ccat="highlight --out-format=ansi" \ + ip="ip -color=auto" + +# These common commands are just too long! Abbreviate them. +alias \ + cl="clear" \ + ka="killall" \ + trem="transmission-remote" \ + YT="youtube-viewer" \ + sdn="shutdown -h now" \ + e="$EDITOR" \ + v="$EDITOR" \ + p="paru" \ + z="zathura" \ + lg="lazygit" \ + sx="swayimg" \ + md="monerod --prune-blockchain --fast-block-sync 1 --data-dir /mnt/ssd/monero/bitmonero" \ + fetch="fastfetch" \ + de="doasedit" + +# Git related +alias \ + g="git" \ + gs="git status --short" \ + gd="git diff" \ + ga="git add" \ + gc="git commit" \ + gp="git push" \ + gu="git pull" \ + gl="git log" \ + gb="git branch" \ + gi="git init" \ + gcl="git clone" + +alias \ + magit="nvim -c MagitOnly" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" |