Skip to content

Instantly share code, notes, and snippets.

@hsimah
Created September 6, 2020 21:05
Show Gist options
  • Save hsimah/709d8fbdc39e6a83134f356941c1dca6 to your computer and use it in GitHub Desktop.
Save hsimah/709d8fbdc39e6a83134f356941c1dca6 to your computer and use it in GitHub Desktop.
.bashrc for WordPress, WSL2 & Docker
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
HISTFILE=/root/.bash_history
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# print branch name at prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\033[01;34m\]\w\[\033[00m\]\[\e[91m\]\$(parse_git_branch)\[\e[00m\]$ "
# workaround for windows config being pushed to container
git config --global core.sshcommand /usr/bin/ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment