Skip to content

Instantly share code, notes, and snippets.

@xsqf
Last active December 26, 2024 20:36
Show Gist options
  • Save xsqf/8307998f4596c14cd78fb2115069dd13 to your computer and use it in GitHub Desktop.
Save xsqf/8307998f4596c14cd78fb2115069dd13 to your computer and use it in GitHub Desktop.
aliasconfig
#!/usr/bin/env bash
# go dev
alias godev="cd ~/dev/"
# config management
alias aliasconfig="subl $ZSH_CUSTOM/.aliases"
alias zshconfig="subl ~/.zshrc"
# do not "source ~/.zshrc" as it can have unintended consequences.
alias zshrefresh="exec zsh"
alias ohmyzsh="subl ~/.oh-my-zsh"
alias hyperconfig="subl ~/.hyper.js"
alias neofetchconfig="subl ~/.config/neofetch/config.conf"
# nav
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# colorize `ls` output by default
alias ls='ls -G'
# header peep
alias csvhead='function __head() {head -1 $@ | gsed "s/,/\n/g" | nl}; __head'
alias tsvhead='function __head() {head -1 $@ | gsed "s/\t/\n/g" | nl}; __head'
# Git aliases
alias gs="git status"
alias ga="git add"
alias gc="git commit"
alias gcom="git checkout main"
alias gcomp="git checkout main && git pull"
alias gcod="git checkout develop && git pull"
alias gcob="git checkout -b"
alias gco="git checkout"
alias gb="git branch"
alias gpull="git pull"
alias gpush="git push"
alias gpuo="git push -u origin"
alias gf="git fetch"
alias gm="git merge"
alias gstash="git stash"
alias gsp="git stash pop"
alias gbsort="git branch --sort=committerdate"
alias gucount="git shortlog -s | sort"
alias git-dumpster-fire='for d in $(find ~/dev -name ".git" -print0 | xargs -0 -n1 dirname) ; do (cd "$d" && git branch --merged | egrep -v "(^\*|main|dev)" | xargs git branch -d) ; done'
# why not [legacy Inspire]
# alias godmode="god && gcom && gf && gpull"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment