Skip to content

Instantly share code, notes, and snippets.

@davidharting
Created August 14, 2018 12:49
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 davidharting/0aecfa9164ae41a53a88c612f06a4d59 to your computer and use it in GitHub Desktop.
Save davidharting/0aecfa9164ae41a53a88c612f06a4d59 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# The bash-it theme that I use
# This is baserd on the Minimal theme with Python version and node version prepended
# Because the prompt gets long with the versions, a new line is appended and a
# $ prompt character is added
SCM_THEME_PROMPT_PREFIX="${cyan}(${green}"
SCM_THEME_PROMPT_SUFFIX="${cyan})"
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
node_version()
{
local br
br=$(node -v)
test -n "$br" && printf %s "$br" || :
}
green=$'\e[1;32m'
magenta=$'\e[1;35m'
normal_colours=$'\e[m'
PS1="${PS1:0:$((${#PS1} - 2))} \[$magenta\]\$(_node_version)\[$normal_colours\]\$ "
prompt() {
PS1="${green}$(node_version) ${yellow}$(python_version_prompt) $(scm_prompt_info)${reset_color} ${cyan}\W${reset_color}\n$ "
}
safe_append_prompt_command prompt
@davidharting
Copy link
Author

I should try to remove number of stashes from my prompt. That is almost never useful information to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment