aboutsummaryrefslogblamecommitdiff
path: root/.config/aliasrc
blob: 822d6d50dde363974c8b85f4d335e18108431ed9 (plain) (tree)




























































                                                                    
# Nick's light shell aliases

# General utility
command -v doas >/dev/null \
	&& alias sudo="doas " \
	|| alias sudo="sudo "
alias cp="cp -iv"
alias mv="mv -iv"

# Utility colours
alias ls="ls --color=auto --group-directories-first"
alias grep="grep --color=auto"
alias diff="diff --color=auto"

# dotfiles management
alias d="git --git-dir=$HOME/.dotlite.git --work-tree=$HOME"

# Shortcuts
alias v="$EDITOR"
alias vi="$EDITOR"
alias vim="$EDITOR"
alias e="$FILE"
alias r="ranger"
alias g="git"
alias o="xdg-open"

# Utility quick commands
alias mem="ps axch -o cmd:15,%mem --sort=-%mem | sed 10q"
alias cpu="ps axch -o cmd:15,%cpu --sort=-%cpu | sed 10q"
alias rcp="rsync -vzrh --times --stats --progress --itemize-changes"

# Arch
# pacman
alias p="sudo pacman"
alias pS="sudo pacman -S"
alias pR="sudo pacman -R"
alias pU="sudo pacman -Syu"
alias pQ="pacman -Q"
# yay (AUR)
alias y="yay"
alias yS="yay -S"
alias yR="yay -R"
alias yU="yay -Syu"

# Fedora
alias dI="sudo dnf install"
alias dR="sudo dnf remove"
alias dU="sudo dnf upgrade"
alias dQ="rpm -qa"

# Utility functions
# Fuzzy find file + open in editor
vf() { fzf | xargs -r -I % $EDITOR % ;}

# Config files
alias cfb="$EDITOR $HOME/.bashrc"
alias cfz="$EDITOR $HOME/.zshrc"
alias cfp="$EDITOR $HOME/.profile"
alias cfv="$EDITOR $HOME/.config/nvim/init.vim"
alias cfa="$EDITOR $HOME/.config/aliasrc"
alias cfg="$EDITOR $HOME/.config/git/config"