#!/bin/sh # Aliases for all shells # Detect which `ls` flavor is in use if ls --color > /dev/null 2>&1; then # GNU `ls` colorflag="--color" elif ls -G > /dev/null 2>&1; then # macOS `ls` colorflag="-G" fi # ls aliases alias ls='ls ${colorflag}' alias l='ls -lAh ${colorflag}' alias ll='ls -lh ${colorflag}' # Git aliases alias ga='git add' alias gc='git commit --verbose' alias gd='git diff' alias gp='git push' alias gs='git status' alias gst='git status' alias gl='git pull' alias gco='git checkout' alias gf='git fetch' alias glg='git log --stat --decorate' alias glgr='git log --oneline | head -n 10' alias g_='git stash' alias g_p='git stash pop' alias gb='git branch' alias grb='git rebase' alias grs='git reset' alias gm='git merge' alias gg='git grep' alias vlg='vim -c "GV"' # 'vim log' of a file # Quick Actions alias curljson='curl -H "Content-Type: application/json"' alias sysmail='mutt -f /var/mail/$USER' # Lightweight funcs aw() { w3m "https://wiki.archlinux.org/index.php?search=$1"; } ddg() { w3m "https://duckduckgo.com/lite?q=$1"; }