LOCAL_GIT_DIR=${HOME}/.local/git alias ga='git add .; git commit --no-edit --amend; git push --force-with-lease' alias gae='git add .; git commit --amend; git push --force-with-lease' gd() { curr_branch=$(git symbolic-ref --short -q HEAD) if [ $curr_branch = "master" ]; then echo "On master, aborting." return fi git checkout master git branch -D ${curr_branch} git pull } alias gl="git log --graph --abbrev-commit --date=short --pretty=format:'%Cred%h%Creset %Cgreen%cr%Creset: %s : %C(bold blue)%an%Creset %C(yellow)%d%Creset'" alias lg=lazygit alias less='less -R' if [[ $(command -v bat) ]]; then alias cat='bat -pp --color=always --tabs=2 --theme=Monokai\ Extended\ Light' fi if [[ $(command -v eza) ]]; then alias ls='eza --git --octal-permissions --no-permissions --group-directories-first' alias ll='eza --git --octal-permissions --no-permissions --group-directories-first -l' else case $(uname -s) in; Darwin) alias ls='ls -G';; Linux) alias ls='ls --color';; esac alias ll='ls -l' fi if [[ $(command -v fd) ]]; then if [[ -f ~/.local/config/fd ]]; then alias fd='fd -H -L --ignore-file ~/.local/config/fd' else alias fd='fd -H -L' fi fi if [ $(command -v nvim) ]; then export EDITOR=nvim export MANPAGER="nvim +Man!" alias vim=nvim alias vimdiff="nvim -d" elif [ $(command -v vim) ] ; then export EDITOR=vim else export EDITOR=vi fi if [[ $(command -v rg) ]]; then alias grep='rg -i' else alias grep='grep --color' fi function ud() { for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done . "${LOCAL_GIT_DIR}/dotfiles/scripts/post-update.sh" } function upgrade() { if [ $(uname -s) != "Darwin" ]; then case $(lsb_release -si) in Gentoo) eix-sync && eix-update && emerge -avuNDU @world ;; VoidLinux) xbps-install -Su && xbps-remove -RoO && xlocate -S ;; esac else brew update && brew upgrade && brew cleanup rm -rf ~/Library/Caches/Homebrew/* fi }