.aliases (1067B) [raw]
1 #!/bin/sh 2 # Aliases for all shells 3 4 # Detect which `ls` flavor is in use 5 if ls --color > /dev/null 2>&1; then # GNU `ls` 6 colorflag="--color" 7 elif ls -G > /dev/null 2>&1; then # macOS `ls` 8 colorflag="-G" 9 fi 10 11 # ls aliases 12 alias ls='ls ${colorflag}' 13 alias l='ls -lAh ${colorflag}' 14 alias ll='ls -lh ${colorflag}' 15 16 # Git aliases 17 alias ga='git add' 18 alias gc='git commit --verbose' 19 alias gd='git diff' 20 alias gp='git push' 21 alias gs='git status' 22 alias gst='git status' 23 alias gl='git pull' 24 alias gco='git checkout' 25 alias gf='git fetch' 26 alias glg='git log --stat --decorate' 27 alias glgr='git log --oneline | head -n 10' 28 alias g_='git stash' 29 alias g_p='git stash pop' 30 alias gb='git branch' 31 alias grb='git rebase' 32 alias grs='git reset' 33 alias gm='git merge' 34 alias gg='git grep' 35 alias vlg='vim -c "GV"' # 'vim log' of a file 36 37 # Quick Actions 38 alias curljson='curl -H "Content-Type: application/json"' 39 alias sysmail='mutt -f /var/mail/$USER' 40 41 # Lightweight funcs 42 aw() { w3m "https://wiki.archlinux.org/index.php?search=$1"; } 43 ddg() { w3m "https://duckduckgo.com/lite?q=$1"; }