aboutsummaryrefslogblamecommitdiff
path: root/.config/aliasrc
blob: 74d6ec44a54b5860930296ff7a73a49ac0b57135 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                               
                              





                                                            




































                                                                    







                               










                                               
                                           

                                               
# 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 grep="grep --color=auto"
if [ "$(uname -s)" != "Darwin" ]; then
	alias ls="ls --color=auto --group-directories-first"
	alias diff="diff --color=auto"
else
	alias ls="ls -G"
fi

# 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"

# macOS
alias bI="brew install"
alias bIc="brew install --cask"
alias bR="brew uninstall"
alias bU="brew upgrade"
alias bQ="brew list"
alias bQc="brew list --cask"

# 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"
alias cfi="$EDITOR $HOME/.config/i3/config"
alias cfy="$EDITOR $HOME/.config/yabai/yabairc"
alias cfs="$EDITOR $HOME/.config/skhd/skhdrc"