Skip to content

Instantly share code, notes, and snippets.

@cayblood
Last active November 2, 2019 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cayblood/1fb345f2bc093207d80200060a0d430e to your computer and use it in GitHub Desktop.
Save cayblood/1fb345f2bc093207d80200060a0d430e to your computer and use it in GitHub Desktop.
# 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