Skip to content

Instantly share code, notes, and snippets.

@cayblood cayblood/prompt.bash
Last active Nov 2, 2019

What would you like to do?
# display user@host and current working dir
PS1='\[$(tput setaf 2)\]\u\[$(tput sgr0)\]@\[$(tput setaf 3)\]\h\[$(tput sgr0)\] \w'
# display git info if applicable
PS1=$PS1'\[$(tput setaf 5)\]`if [ "$(vcprompt)" != "" ]; then echo " $(vcprompt | tr -d '"'"'[:space:]'"'"')"; fi`'
# display rvm info if applicable
PS1=$PS1'\[$(tput setaf 1)\] [`if [ "$(~/.rvm/bin/rvm-prompt)" != "" ]; then echo "$(~/.rvm/bin/rvm-prompt)"; fi`]\[$(tput sgr0)\]'
# display nvm info if available
PS1=$PS1'\[$(tput setaf 6)\] [node-`re='"'"'([^/v]+)/bin$'"'"'; nvm=$([[ $NVM_BIN =~ $re ]] && echo "${BASH_REMATCH[1]}" || echo "system"); echo "$nvm"`]\[$(tput sgr0)\]'
# display newline and prompt character
export PS1=$PS1' \[$(tput sgr0)\]\n∴ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.