Skip to content

Instantly share code, notes, and snippets.

@saursin
Created January 14, 2024 06:36
Show Gist options
  • Save saursin/79f60ec68f18fca893848971f4f7e730 to your computer and use it in GitHub Desktop.
Save saursin/79f60ec68f18fca893848971f4f7e730 to your computer and use it in GitHub Desktop.
Simple bashrc for dev containers
################################################################################
# A Simple Bashrc for dev containers
clr_blk="\[\033[01;30m\]" # Black
clr_red="\[\033[01;31m\]" # Red
clr_grn="\[\033[01;32m\]" # Green
clr_ylw="\[\033[01;33m\]" # Yellow
clr_blu="\[\033[01;34m\]" # Blue
clr_mgn="\[\033[01;35m\]" # Purple
clr_cyn="\[\033[01;36m\]" # Cyan
clr_wht="\[\033[01;37m\]" # White
clr_nc="\[\033[00m\]" # Reset
# 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=2000
HISTFILESIZE=2000
# add date and time formatting to bash history
HISTTIMEFORMAT="%F %T "
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="${clr_grn}\W@\u${clr_mgn}\$(parse_git_branch)${clr_grn} $ ${clr_nc}"
# common aliases
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias l='ls'
alias ls='ls --color'
alias la='ls -a'
alias ll='ls -lah'
alias grep='grep --color=auto'
alias cl='clear'
alias vi='vim'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment