Last active
August 16, 2021 15:46
-
-
Save skarrman/b9fb989b75f31fc0a54e7617c8636c11 to your computer and use it in GitHub Desktop.
Bash profile base config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General alias | |
alias c='code .' | |
alias nt='open . -a Terminal' | |
# Increase history file size | |
HISTSIZE=100000 | |
HISTFILESIZE=100000 | |
# Sync history: | |
# Avoid duplicates | |
HISTCONTROL=ignoredups:erasedups | |
# When the shell exits, append to the history file instead of overwriting it | |
shopt -s histappend | |
# After each command, append to the history file and reread it | |
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" | |
# Git autocomplete - Brew package install required | |
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion | |
# Git branch in prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\h:\W \u\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment