Skip to content

Instantly share code, notes, and snippets.

@flysand7
Created October 17, 2023 01:21
Show Gist options
  • Save flysand7/cbc3f48233b07d3ca0d6f15b865bdda2 to your computer and use it in GitHub Desktop.
Save flysand7/cbc3f48233b07d3ca0d6f15b865bdda2 to your computer and use it in GitHub Desktop.
My bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias grep='grep --color=auto'
function repeat {
for i in `seq 1 $1`; do echo -n "$2"; done
}
function git_branch {
GIT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null)
if [ $? -ne 0 ]; then
echo ""
else
echo "[$GIT_BRANCH]"
fi
}
function nesting {
repeat $(($(dirs -v | wc -l)-1)) '+'
}
export PATH=$PATH:~/.local/bin
PS1='\[\e[33m\]\T \[\e[34m\]\u@\w\[\e[31m\]$(nesting)\[\e[35m\]$(git_branch)\[\e[0m\]\$ '
source /usr/share/nvm/init-nvm.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment