Skip to content

Instantly share code, notes, and snippets.

View mmxcrono's full-sized avatar

Hoang Nguyen mmxcrono

View GitHub Profile
mmxcrono / .bashrc
Last active March 1, 2024 19:15
Add terminal colors, git branch name, convenient aliases to your ~/.bashrc file
# --------------
# Functions
# --------------
# Parse branch name and format output
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
# Switch to main or a new branch based on current one
mmxcrono / .vimrc
Last active October 20, 2023 15:29
Add some syntax highlighting and autoindex to your ~/.vimrc file
set autoindent
syntax on
colorscheme koehler
mmxcrono / .gitconfig
Last active March 1, 2024 19:39
Add git aliases to your ~/.gitconfig file
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n''%C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'