From a694d2de9c6673bdd6791c4132a19ab8989a0f99 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Sun, 29 May 2011 15:25:26 -0500 Subject: [PATCH 01/43] Allow specifying jQuery/jQuery UI version number and update defaults --- plugins/available/javascript.plugins.bash | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/plugins/available/javascript.plugins.bash b/plugins/available/javascript.plugins.bash index 2e0b56cb..a480d9e4 100644 --- a/plugins/available/javascript.plugins.bash +++ b/plugins/available/javascript.plugins.bash @@ -3,15 +3,30 @@ # The install directory is hard-coded. TOOD: allow the directory to be specified on the command line. # +[[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1" +[[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13" function rails_jquery { curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js } function jquery_install { - curl -o public/javascripts/jquery.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js + if [ -z "$1" ] + then + version=$JQUERY_VERSION_NUMBER + else + version="$1" + fi + curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js" } -function jquery_ui_install { - curl -o public/javascripts/jquery_ui.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js -} \ No newline at end of file +function jquery_ui_install { + if [ -z "$1" ] + then + version=$JQUERY_UI_VERSION_NUMBER + else + version="$1" + fi + + curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js" +} From 20d5f97f3e14545a120c1ade2c0404943fec8e41 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 30 May 2011 09:46:22 -0500 Subject: [PATCH 02/43] Load RVM and auto-completion is available No reason not to turn on RVM if it's present and the autocompletion is a huge benefit. --- plugins/available/rvm.plugin.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/available/rvm.plugin.bash b/plugins/available/rvm.plugin.bash index d3c81ed4..97f02146 100644 --- a/plugins/available/rvm.plugin.bash +++ b/plugins/available/rvm.plugin.bash @@ -1,4 +1,14 @@ #!/bin/bash + +# Load RVM, if you are using it +[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm + +# Load the auto-completion script if RVM was loaded. +if [ "$rvm_path" ] +then + [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion +fi + switch () { rvm $1 local v=$(rvm_version) From b740d7f0f731e9029720d012c289dd00056120f1 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 30 May 2011 09:52:30 -0500 Subject: [PATCH 03/43] Make sure that RVM is loaded before defining extras --- plugins/available/rvm.plugin.bash | 37 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/plugins/available/rvm.plugin.bash b/plugins/available/rvm.plugin.bash index 97f02146..e158a800 100644 --- a/plugins/available/rvm.plugin.bash +++ b/plugins/available/rvm.plugin.bash @@ -3,24 +3,27 @@ # Load RVM, if you are using it [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm -# Load the auto-completion script if RVM was loaded. +# Check to make sure that RVM is actually loaded before adding +# the customizations to it. if [ "$rvm_path" ] then + # Load the auto-completion script if RVM was loaded. [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion + + switch () { + rvm $1 + local v=$(rvm_version) + rvm wrapper $1 textmate + echo "Switch to Ruby version: "$v + } + + rvm_default () { + rvm --default $1 + rvm wrapper $1 textmate + } + + function rvm_version () { + ruby --version + } + fi - -switch () { - rvm $1 - local v=$(rvm_version) - rvm wrapper $1 textmate - echo "Switch to Ruby version: "$v -} - -rvm_default () { - rvm --default $1 - rvm wrapper $1 textmate -} - -function rvm_version () { - ruby --version -} \ No newline at end of file From 9623fd442fabd8f6e9df569900b91abaed63403e Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 30 May 2011 10:12:51 -0500 Subject: [PATCH 04/43] Allow clock to be formatted --- themes/doubletime/doubletime.theme.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/doubletime/doubletime.theme.bash b/themes/doubletime/doubletime.theme.bash index c5a8a420..91844f0e 100644 --- a/themes/doubletime/doubletime.theme.bash +++ b/themes/doubletime/doubletime.theme.bash @@ -37,8 +37,14 @@ prompt_setter() { history -a history -c history -r + if [[ -z "$THEME_PROMPT_CLOCK_FORMAT" ]] + then + clock="\t" + else + clock=$THEME_PROMPT_CLOCK_FORMAT + fi PS1=" -\t $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] $(virtualenv_prompt)\w +$clock $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] $(virtualenv_prompt)\w $(doubletime_scm_prompt)\[$reset_color\] $ " PS2='> ' PS4='+ ' From 1a83a4d1939a6e182664bd78dac6f6296103f5d4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 May 2011 13:19:20 -1000 Subject: [PATCH 05/43] Added hawaii50 theme --- themes/hawaii50/hawaii50.theme.bash | 118 ++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 themes/hawaii50/hawaii50.theme.bash diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash new file mode 100644 index 00000000..a81cc0b9 --- /dev/null +++ b/themes/hawaii50/hawaii50.theme.bash @@ -0,0 +1,118 @@ +#!/bin/basORANGEh + +# Colors +ORANGE='\e[0;33m' +GREY='\e[1:37m' + +DEFAULT_COLOR='\[${white}\]' + +USER_COLOR='\[${purple}\]' +SUPERUSER_COLOR='\[${red}\]' +MACHINE_COLOR=$ORANGE +DIRECTORY_COLOR='\[${bold_green}\]' + +VE_COLOR='\[${red}\]' +RVM_COLOR='\[${purple}\]' + +# SCM prompts +SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' +SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' + +# Max length of PWD to display +MAX_PWD_LENGTH=20 + +# Max length of Git Hex to display +MAX_GIT_HEX_LENGTH=5 + +# Use http://geoff.greer.fm/lscolors/ + +# Displays the current virtualenv information +function curr_virtualenv_info() { + [ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`" +} + +# Displays the current rvm information w/gemset +function curr_rvm_info() { + local ruby_version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') + local ruby_gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') + + if [ "$ruby_version" != "" ]; then + [ "$ruby_gemset" != "" ] && ruby_gemset="@$ruby_gemset" + echo "$ruby_version$ruby_gemset" + fi +} + +# Displays using ... +function virtual_info() { + local virtual_env_info=$(curr_virtualenv_info) + local rvm_info=$(curr_rvm_info) + local prompt="using" + + # If no virtual info, just return + [ "$virtual_env_info" == "" -a "$rvm_info" == "" ] && return + + # If virtual_env info present, append to prompt + [ "$virtual_env_info" != "" ] && prompt="$prompt virtualenv: ${VE_COLOR}$virtual_env_info${DEFAULT_COLOR}" + + if [ "$rvm_info" != "" ] + then + [ "$virtual_env_info" != "" ] && prompt="$prompt," + prompt="$prompt rvm: ${RVM_COLOR}$rvm_info${DEFAULT_COLOR}" + fi + echo $prompt +} + + +# SCM information +function scm_info() { + SCM_CHAR=$(scm_char) + [ "$SCM_CHAR" == "$SCM_NONE_CHAR" ] && return + local prompt="on" + [ "$SCM_CHAR" == "$SCM_GIT_CHAR" ] && echo "$prompt$(parse_git_info)" && return +} + +# Parse git info +function parse_git_info() { + if [[ -n $(git status -s 2> /dev/null |grep -v ^# |grep -v "working directory clean") ]]; then + state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${GIT_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${GIT_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + rawhex=$(git rev-parse HEAD 2>/dev/null) || return + + echo -e "$prefix${ref#refs/heads/} (${rawhex:0:$MAX_GIT_HEX_LENGTH})$state$suffix" +} + +# Displays last X characters of pwd +function limited_pwd() { + + # Replace $HOME with ~ if possible + RELATIVE_PWD=${PWD/#$HOME/\~} + + local offset=$((${#RELATIVE_PWD}-$MAX_PWD_LENGTH)) + + if [ $offset -gt "0" ] + then + local truncated_symbol="..." + TRUNCATED_PWD=${RELATIVE_PWD:$offset:$MAX_PWD_LENGTH} + echo "${truncated_symbol}/${TRUNCATED_PWD#*/}" + else + echo "${RELATIVE_PWD}" + fi +} + +# Displays the current prompt +function prompt() { + + local UC=$USER_COLOR + [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR + + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR} $(virtual_info) $(scm_info) \$ " + PS2='> ' + PS4='+ ' +} + +PROMPT_COMMAND=prompt From 06d71ab59141b536a9a0bdd22791a002fa98def5 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 May 2011 16:10:30 -1000 Subject: [PATCH 06/43] Updated git prompt Started hg prompt --- themes/hawaii50/hawaii50.theme.bash | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index a81cc0b9..987153b3 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -24,6 +24,12 @@ MAX_PWD_LENGTH=20 # Max length of Git Hex to display MAX_GIT_HEX_LENGTH=5 +GIT_THEME_PROMPT_PREFIX=' |git:' +GIT_THEME_PROMPT_SUFFIX='|' + +HG_THEME_PROMPT_PREFIX=' |hg:' +HG_THEME_PROMPT_SUFFIX='|' + # Use http://geoff.greer.fm/lscolors/ # Displays the current virtualenv information @@ -62,13 +68,14 @@ function virtual_info() { echo $prompt } - # SCM information function scm_info() { SCM_CHAR=$(scm_char) [ "$SCM_CHAR" == "$SCM_NONE_CHAR" ] && return local prompt="on" [ "$SCM_CHAR" == "$SCM_GIT_CHAR" ] && echo "$prompt$(parse_git_info)" && return + [ "$SCM_CHAR" == "$SCM_SVN_CHAR" ] && echo "$prompt$(parse_svn_info)" && return + [ "$SCM_CHAR" == "$SCM_HG_CHAR" ] && echo "$prompt$(parse_hg_info)" && return } # Parse git info @@ -83,9 +90,24 @@ function parse_git_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return rawhex=$(git rev-parse HEAD 2>/dev/null) || return - echo -e "$prefix${ref#refs/heads/} (${rawhex:0:$MAX_GIT_HEX_LENGTH})$state$suffix" + echo "$prefix${ref#refs/heads/}=#${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" } +# Parse hg info +function parse_hg_info() { + if [[ -n $(hg status --no-color 2> /dev/null| awk '$1 == "?" { print "?" } $1 = "?" { print "!" }' | sort | uniq | head -c1) ]]; then + state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + branch=$(hg branch 2> /dev/null | awk '{print $1}') + + echo "$prefix$branch$state$suffix" +} + + # Displays last X characters of pwd function limited_pwd() { From aa2f1cbeb7141a24d154de15b35f3f51914f285a Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 May 2011 18:41:07 -1000 Subject: [PATCH 07/43] Added hg dirty/clean modifier --- themes/hawaii50/hawaii50.theme.bash | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 987153b3..656649b4 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -32,6 +32,16 @@ HG_THEME_PROMPT_SUFFIX='|' # Use http://geoff.greer.fm/lscolors/ +# Override function scm +function scm { + if [[ -d .git ]]; then SCM=$GIT + elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$GIT + elif [[ -n "$(hg summary 2> /dev/null)" ]]; then SCM=$HG + elif [[ -d .svn ]]; then SCM=$SVN + else SCM='NONE' + fi +} + # Displays the current virtualenv information function curr_virtualenv_info() { [ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`" @@ -90,21 +100,22 @@ function parse_git_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return rawhex=$(git rev-parse HEAD 2>/dev/null) || return - echo "$prefix${ref#refs/heads/}=#${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" + echo "$prefix${ref#refs/heads/}:${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" } # Parse hg info function parse_hg_info() { - if [[ -n $(hg status --no-color 2> /dev/null| awk '$1 == "?" { print "?" } $1 = "?" { print "!" }' | sort | uniq | head -c1) ]]; then + if [[ -n $(hg status 2> /dev/null) ]]; then state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} fi prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} - branch=$(hg branch 2> /dev/null | awk '{print $1}') + branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') + changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') - echo "$prefix$branch$state$suffix" + echo "$prefix${branch}:${changeset#*:}$state$suffix" } From 2a6d1da317e4aafab8cfcd2ca8702379d9a8ac06 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 May 2011 19:03:28 -1000 Subject: [PATCH 08/43] Updated parse_svn_info --- themes/hawaii50/hawaii50.theme.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 656649b4..16ecf07c 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -30,6 +30,9 @@ GIT_THEME_PROMPT_SUFFIX='|' HG_THEME_PROMPT_PREFIX=' |hg:' HG_THEME_PROMPT_SUFFIX='|' +SVN_THEME_PROMPT_PREFIX=' |svn:' +SVN_THEME_PROMPT_SUFFIX='|' + # Use http://geoff.greer.fm/lscolors/ # Override function scm @@ -118,6 +121,20 @@ function parse_hg_info() { echo "$prefix${branch}:${changeset#*:}$state$suffix" } +# Parse svn info +function parse_svn_info() { + if [[ -n $(svn status --ignore-externals -q 2> /dev/null) ]]; then + state=${SVN_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${SVN_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${SVN_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${SVN_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + ref=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') || return + revision=$(svn info 2> /dev/null | sed -ne 's#^Revision: ##p' ) + [[ -z $ref ]] && return + echo -e "$prefix$ref:$revision$state$suffix" +} # Displays last X characters of pwd function limited_pwd() { From 09dfe7552c4b9538df85fabef855a5c7e941f5f2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 May 2011 19:17:10 -1000 Subject: [PATCH 09/43] Added ip address (only good for a mac) :D ) --- themes/hawaii50/hawaii50.theme.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 16ecf07c..1a9281df 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -9,6 +9,7 @@ DEFAULT_COLOR='\[${white}\]' USER_COLOR='\[${purple}\]' SUPERUSER_COLOR='\[${red}\]' MACHINE_COLOR=$ORANGE +IP_COLOR=$MACHINE_COLOR DIRECTORY_COLOR='\[${bold_green}\]' VE_COLOR='\[${red}\]' @@ -35,6 +36,10 @@ SVN_THEME_PROMPT_SUFFIX='|' # Use http://geoff.greer.fm/lscolors/ +function ip { + echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') +} + # Override function scm function scm { if [[ -d .git ]]; then SCM=$GIT @@ -160,7 +165,7 @@ function prompt() { local UC=$USER_COLOR [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR} $(virtual_info) $(scm_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR} $(virtual_info) $(scm_info) \$ " PS2='> ' PS4='+ ' } From 9bd5b5498498f2623ede326fde33afdf87456f86 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Tue, 31 May 2011 21:23:33 -1000 Subject: [PATCH 10/43] Added color to the scm prompt --- themes/hawaii50/hawaii50.theme.bash | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 1a9281df..bf493efc 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -15,6 +15,9 @@ DIRECTORY_COLOR='\[${bold_green}\]' VE_COLOR='\[${red}\]' RVM_COLOR='\[${purple}\]' +SCM_COLOR=$ORANGE +REF_COLOR='\[${purple}\]' + # SCM prompts SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' @@ -25,13 +28,13 @@ MAX_PWD_LENGTH=20 # Max length of Git Hex to display MAX_GIT_HEX_LENGTH=5 -GIT_THEME_PROMPT_PREFIX=' |git:' +GIT_THEME_PROMPT_PREFIX=" |${SCM_COLOR}git${DEFAULT_COLOR}:" GIT_THEME_PROMPT_SUFFIX='|' -HG_THEME_PROMPT_PREFIX=' |hg:' +HG_THEME_PROMPT_PREFIX=" |${SCM_COLOR}hg${DEFAULT_COLOR}:" HG_THEME_PROMPT_SUFFIX='|' -SVN_THEME_PROMPT_PREFIX=' |svn:' +SVN_THEME_PROMPT_PREFIX=" |${SCM_COLOR}svn${DEFAULT_COLOR}:" SVN_THEME_PROMPT_SUFFIX='|' # Use http://geoff.greer.fm/lscolors/ @@ -108,7 +111,7 @@ function parse_git_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return rawhex=$(git rev-parse HEAD 2>/dev/null) || return - echo "$prefix${ref#refs/heads/}:${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" + echo "$prefix${REF_COLOR}${ref#refs/heads/}${DEFAULT_COLOR}:${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" } # Parse hg info @@ -123,7 +126,7 @@ function parse_hg_info() { branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') - echo "$prefix${branch}:${changeset#*:}$state$suffix" + echo "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" } # Parse svn info @@ -138,7 +141,7 @@ function parse_svn_info() { ref=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') || return revision=$(svn info 2> /dev/null | sed -ne 's#^Revision: ##p' ) [[ -z $ref ]] && return - echo -e "$prefix$ref:$revision$state$suffix" + echo -e "$prefix${REF_COLOR}$ref${DEFAULT_COLOR}:$revision$state$suffix" } # Displays last X characters of pwd From 0611f861bc15752e3d5c407ce6bb1a7cef180355 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Tue, 31 May 2011 21:38:41 -1000 Subject: [PATCH 11/43] Changed color schemes Completely removed prefix/suffix for scm --- themes/hawaii50/hawaii50.theme.bash | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index bf493efc..378512fa 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -10,10 +10,10 @@ USER_COLOR='\[${purple}\]' SUPERUSER_COLOR='\[${red}\]' MACHINE_COLOR=$ORANGE IP_COLOR=$MACHINE_COLOR -DIRECTORY_COLOR='\[${bold_green}\]' +DIRECTORY_COLOR='\[${green}\]' -VE_COLOR='\[${red}\]' -RVM_COLOR='\[${purple}\]' +VE_COLOR='\[${cyan}\]' +RVM_COLOR='\[${cyan}\]' SCM_COLOR=$ORANGE REF_COLOR='\[${purple}\]' @@ -28,16 +28,9 @@ MAX_PWD_LENGTH=20 # Max length of Git Hex to display MAX_GIT_HEX_LENGTH=5 -GIT_THEME_PROMPT_PREFIX=" |${SCM_COLOR}git${DEFAULT_COLOR}:" -GIT_THEME_PROMPT_SUFFIX='|' - -HG_THEME_PROMPT_PREFIX=" |${SCM_COLOR}hg${DEFAULT_COLOR}:" -HG_THEME_PROMPT_SUFFIX='|' - -SVN_THEME_PROMPT_PREFIX=" |${SCM_COLOR}svn${DEFAULT_COLOR}:" -SVN_THEME_PROMPT_SUFFIX='|' - -# Use http://geoff.greer.fm/lscolors/ +# Removed prefix/suffix +SCM_THEME_PROMPT_PREFIX=" " +SCM_THEME_PROMPT_SUFFIX="" function ip { echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') @@ -73,11 +66,12 @@ function curr_rvm_info() { function virtual_info() { local virtual_env_info=$(curr_virtualenv_info) local rvm_info=$(curr_rvm_info) - local prompt="using" # If no virtual info, just return [ "$virtual_env_info" == "" -a "$rvm_info" == "" ] && return + local prompt=" using" + # If virtual_env info present, append to prompt [ "$virtual_env_info" != "" ] && prompt="$prompt virtualenv: ${VE_COLOR}$virtual_env_info${DEFAULT_COLOR}" @@ -86,14 +80,14 @@ function virtual_info() { [ "$virtual_env_info" != "" ] && prompt="$prompt," prompt="$prompt rvm: ${RVM_COLOR}$rvm_info${DEFAULT_COLOR}" fi - echo $prompt + echo "$prompt" } # SCM information function scm_info() { SCM_CHAR=$(scm_char) [ "$SCM_CHAR" == "$SCM_NONE_CHAR" ] && return - local prompt="on" + local prompt=" on" [ "$SCM_CHAR" == "$SCM_GIT_CHAR" ] && echo "$prompt$(parse_git_info)" && return [ "$SCM_CHAR" == "$SCM_SVN_CHAR" ] && echo "$prompt$(parse_svn_info)" && return [ "$SCM_CHAR" == "$SCM_HG_CHAR" ] && echo "$prompt$(parse_hg_info)" && return @@ -168,7 +162,7 @@ function prompt() { local UC=$USER_COLOR [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR} $(virtual_info) $(scm_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(scm_info) \$ " PS2='> ' PS4='+ ' } From 0df98ca8e915910b3b17fbafdb3726ee8acc0f87 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 1 Jun 2011 11:22:22 -1000 Subject: [PATCH 12/43] Various theme cleanup (removing vars, extras) --- themes/hawaii50/hawaii50.theme.bash | 40 +++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 378512fa..4933123c 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -1,6 +1,32 @@ -#!/bin/basORANGEh +#!/bin/bash -# Colors +# This theme was obviously inspired a lot by +# - Demula theme +# +# which in itself was inspired by : +# +# - Ronacher's dotfiles (mitsuhikos) - http://github.com/mitsuhiko/dotfiles/tree/master/bash/ +# - Glenbot - http://theglenbot.com/custom-bash-shell-for-development/ +# - My extravagant zsh - http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ +# - Monokai colors - http://monokai.nl/blog/2006/07/15/textmate-color-theme/ +# - Bash_it modern theme +# +# Things theme supports: +# - shortended directory +# - hg, svn detection +# - virtualenv, rvm +# +# Screenshot: +# +# by Ryan Kanno +# +# And yes, we code out in Hawaii. :D +# +# Note: I also am really new to this bash scripting game, so if you see things +# that are flat out wrong, or if you think of something neat, just send a pull +# request. + +# COLORS ====================================================================== ORANGE='\e[0;33m' GREY='\e[1:37m' @@ -9,18 +35,19 @@ DEFAULT_COLOR='\[${white}\]' USER_COLOR='\[${purple}\]' SUPERUSER_COLOR='\[${red}\]' MACHINE_COLOR=$ORANGE -IP_COLOR=$MACHINE_COLOR +IP_COLOR=$ORANGE DIRECTORY_COLOR='\[${green}\]' VE_COLOR='\[${cyan}\]' RVM_COLOR='\[${cyan}\]' -SCM_COLOR=$ORANGE REF_COLOR='\[${purple}\]' # SCM prompts SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' +SCM_THEME_PROMPT_PREFIX=" " +SCM_THEME_PROMPT_SUFFIX="" # Max length of PWD to display MAX_PWD_LENGTH=20 @@ -28,10 +55,7 @@ MAX_PWD_LENGTH=20 # Max length of Git Hex to display MAX_GIT_HEX_LENGTH=5 -# Removed prefix/suffix -SCM_THEME_PROMPT_PREFIX=" " -SCM_THEME_PROMPT_SUFFIX="" - +# FUNCS ======================================================================= function ip { echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') } From f3787fdc2e6faa3aa9b670c77f3ab57154efd931 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 1 Jun 2011 11:33:41 -1000 Subject: [PATCH 13/43] Added comments to theme --- themes/hawaii50/hawaii50.theme.bash | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 4933123c..a0343a04 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -1,6 +1,7 @@ #!/bin/bash - +# # This theme was obviously inspired a lot by +# # - Demula theme # # which in itself was inspired by : @@ -11,10 +12,11 @@ # - Monokai colors - http://monokai.nl/blog/2006/07/15/textmate-color-theme/ # - Bash_it modern theme # -# Things theme supports: -# - shortended directory -# - hg, svn detection -# - virtualenv, rvm +# Hawaii50 theme supports : +# +# - configurable directory length +# - hg, svn, git detection (I work in all of them) +# - virtualenv, rvm + gemsets # # Screenshot: # @@ -24,7 +26,9 @@ # # Note: I also am really new to this bash scripting game, so if you see things # that are flat out wrong, or if you think of something neat, just send a pull -# request. +# request. This probably only works on a Mac - as some functions are OS +# specific like getting ip, etc. +# # COLORS ====================================================================== ORANGE='\e[0;33m' From 5e95755a19facc2527cf4c008f0a3458493c1a98 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 2 Jun 2011 20:29:16 -0500 Subject: [PATCH 14/43] Add another alias for clear and add some more aliases to alias-help --- aliases/general.aliases.bash | 64 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index d91fbbb6..1e7d4458 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -15,31 +15,32 @@ then alias ls="ls --color=always" fi -alias c='clear' -alias k='clear' +alias c = 'clear' +alias k = 'clear' +alias cls = 'clear' -alias edit="$EDITOR" -alias page="$PAGER" +alias edit = "$EDITOR" +alias page = "$PAGER" -alias q="exit" +alias q = "exit" -alias irc="$IRC_CLIENT" +alias irc = "$IRC_CLIENT" -alias rb="ruby" +alias rb = "ruby" # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ alias piano="pianobar" -alias ..='cd ..' # Go up one directory -alias ...='cd ../..' # Go up two directories -alias -- -="cd -" # Go back +alias .. = 'cd ..' # Go up one directory +alias ... = 'cd ../..' # Go up two directories +alias -- - = "cd -" # Go back # Shell History -alias h='history' +alias h = 'history' # Tree -alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +alias tree = "find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" # Directory alias md='mkdir -p' @@ -48,22 +49,25 @@ alias rd=rmdir function aliases-help() { echo "Generic Alias Usage" echo - echo " sl = ls" - echo " ls = ls -G" - echo " la = ls -AF" - echo " ll = ls -al" - echo " l = ls -a" - echo " c/k = clear" - echo " .. = cd .." - echo " ... = cd ../.." - echo " - = cd -" - echo " h = history" - echo " md = mkdir -p" - echo " rd = rmdir" - echo " editor = $EDITOR" - echo " pager = $PAGER" - echo " piano = pianobar" - echo " q = exit" - echo " irc = $IRC_CLIENT" - echo + echo " sl = ls" + echo " ls = ls -G" + echo " la = ls -AF" + echo " ll = ls -al" + echo " l = ls -a" + echo " c/k/cls = clear" + echo " .. = cd .." + echo " ... = cd ../.." + echo " - = cd -" + echo " h = history" + echo " md = mkdir -p" + echo " rd = rmdir" + echo " editor = $EDITOR" + echo " pager = $PAGER" + echo " piano = pianobar" + echo " q = exit" + echo " irc = $IRC_CLIENT" + echo " md = mkdir -p" + echo " rd = rmdir" + echo " rb = ruby" + echo } From 81b82a80d279e5578c6720d72e3c8986722e2840 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 3 Jun 2011 07:36:31 -0500 Subject: [PATCH 15/43] Fix an idiot mistake I made --- aliases/general.aliases.bash | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 1e7d4458..79bd7aa0 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -15,32 +15,32 @@ then alias ls="ls --color=always" fi -alias c = 'clear' -alias k = 'clear' -alias cls = 'clear' +alias c='clear' +alias k='clear' +alias cls='clear' -alias edit = "$EDITOR" -alias page = "$PAGER" +alias edit="$EDITOR" +alias pager="$PAGER" -alias q = "exit" +alias q="exit" -alias irc = "$IRC_CLIENT" +alias irc="$IRC_CLIENT" -alias rb = "ruby" +alias rb="ruby" # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ alias piano="pianobar" -alias .. = 'cd ..' # Go up one directory -alias ... = 'cd ../..' # Go up two directories -alias -- - = "cd -" # Go back +alias ..='cd ..' # Go up one directory +alias ...='cd ../..' # Go up two directories +alias -- -="cd -" # Go back # Shell History -alias h = 'history' +alias h='history' # Tree -alias tree = "find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" # Directory alias md='mkdir -p' From b7a0cb6133bfde63deff59e90a614f55028735f4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Jun 2011 20:45:53 -0500 Subject: [PATCH 16/43] Added Homebrew aliases --- aliases/homebrew.aliases.bash | 24 ++++++++++++++++++++++++ bash_it.sh | 1 + 2 files changed, 25 insertions(+) create mode 100644 aliases/homebrew.aliases.bash diff --git a/aliases/homebrew.aliases.bash b/aliases/homebrew.aliases.bash new file mode 100644 index 00000000..051081d9 --- /dev/null +++ b/aliases/homebrew.aliases.bash @@ -0,0 +1,24 @@ +# Some aliases for Homebrew + +alias bup="brew update && brew upgrade" +alias bout="brew outdated" +alias bin="brew install" +alias brm="brew uninstall" +alias bls="brew list" +alias bsr="brew search" +alias binf="brew info" +alias bdr="brew doctor" + +function brew-help() { + echo "Homebrew Alias Usage" + echo + echo "bup = brew update && brew upgrade" + echo "bout = brew outdated" + echo "bin = brew install" + echo "brm = brew uninstall" + echo "bls = brew list" + echo "bsr = brew search" + echo "binf = brew info" + echo "bdr = brew doctor" + echo +} diff --git a/bash_it.sh b/bash_it.sh index 4a9b30d3..d63458a0 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -73,6 +73,7 @@ function bash-it() { echo " rails-help This will list out all the aliases you can use with rails." echo " git-help This will list out all the aliases you can use with git." echo " todo-help This will list out all the aliases you can use with todo.txt-cli" + echo " brew-help This will list out all the aliases you can use with Homebrew" echo " aliases-help Generic list of aliases." echo " plugins-help This will list out all the plugins and functions you can use with bash-it" echo From dcb0ddec2f343f8a685b0cd2795454abb5853555 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Tue, 7 Jun 2011 08:25:45 -1000 Subject: [PATCH 17/43] Added comments Added imgur screenshot --- themes/hawaii50/hawaii50.theme.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index a0343a04..ac3bb592 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -18,7 +18,7 @@ # - hg, svn, git detection (I work in all of them) # - virtualenv, rvm + gemsets # -# Screenshot: +# Screenshot: http://i.imgur.com/4IAMJ.png # # by Ryan Kanno # @@ -60,6 +60,8 @@ MAX_PWD_LENGTH=20 MAX_GIT_HEX_LENGTH=5 # FUNCS ======================================================================= + +# TODO: Should check with `uname` and use ip addr function ip { echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') } From c7fcf206480046d4cc9e0f031ea9826b91a0adbf Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 8 Jun 2011 10:20:04 -1000 Subject: [PATCH 18/43] Updated scm function to include `hg root` to check for Mercurial Removed scm function from hawaii50.theme.bash --- themes/base.theme.bash | 1 + themes/hawaii50/hawaii50.theme.bash | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 70876622..948427ac 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -24,6 +24,7 @@ function scm { if [[ -d .git ]]; then SCM=$GIT elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$GIT elif [[ -d .hg ]]; then SCM=$HG + elif [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$HG elif [[ -d .svn ]]; then SCM=$SVN else SCM='NONE' fi diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index ac3bb592..4fb8b1db 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -66,16 +66,6 @@ function ip { echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') } -# Override function scm -function scm { - if [[ -d .git ]]; then SCM=$GIT - elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$GIT - elif [[ -n "$(hg summary 2> /dev/null)" ]]; then SCM=$HG - elif [[ -d .svn ]]; then SCM=$SVN - else SCM='NONE' - fi -} - # Displays the current virtualenv information function curr_virtualenv_info() { [ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`" From 0713fdc031012899bdb02d7e49fd7362af2a3d97 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 8 Jun 2011 11:32:50 -1000 Subject: [PATCH 19/43] Added virtualenv_prompt to base.theme.bash (modeled after rvm_prompt) Removed virtualenv/rvm from hawaii50 theme --- themes/base.theme.bash | 10 ++++++++++ themes/hawaii50/hawaii50.theme.bash | 30 ++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 948427ac..d6be1544 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -20,6 +20,9 @@ SCM_NONE_CHAR='○' RVM_THEME_PROMPT_PREFIX=' |' RVM_THEME_PROMPT_SUFFIX='|' +VIRTUALENV_THEME_PROMPT_PREFIX=' |' +VIRTUALENV_THEME_PROMPT_SUFFIX='|' + function scm { if [[ -d .git ]]; then SCM=$GIT elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$GIT @@ -85,3 +88,10 @@ function rvm_version_prompt { echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX" fi } + +function virtualenv_prompt { + if which virtualenv &> /dev/null; then + virtualenv=$([ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`") || return + echo -e "$VIRTUALENV_THEME_PROMPT_PREFIX$virtualenv$VIRTUALENV_THEME_PROMPT_SUFFIX" + fi +} diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 4fb8b1db..a8e1de27 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -50,8 +50,14 @@ REF_COLOR='\[${purple}\]' # SCM prompts SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' -SCM_THEME_PROMPT_PREFIX=" " -SCM_THEME_PROMPT_SUFFIX="" +SCM_THEME_PROMPT_PREFIX=' ' +SCM_THEME_PROMPT_SUFFIX='' + +RVM_THEME_PROMPT_PREFIX='' +RVM_THEME_PROMPT_SUFFIX='' + +VIRTUALENV_THEME_PROMPT_PREFIX='' +VIRTUALENV_THEME_PROMPT_SUFFIX='' # Max length of PWD to display MAX_PWD_LENGTH=20 @@ -66,26 +72,10 @@ function ip { echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') } -# Displays the current virtualenv information -function curr_virtualenv_info() { - [ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`" -} - -# Displays the current rvm information w/gemset -function curr_rvm_info() { - local ruby_version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') - local ruby_gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') - - if [ "$ruby_version" != "" ]; then - [ "$ruby_gemset" != "" ] && ruby_gemset="@$ruby_gemset" - echo "$ruby_version$ruby_gemset" - fi -} - # Displays using ... function virtual_info() { - local virtual_env_info=$(curr_virtualenv_info) - local rvm_info=$(curr_rvm_info) + local virtual_env_info=$(virtualenv_prompt) + local rvm_info=$(rvm_version_prompt) # If no virtual info, just return [ "$virtual_env_info" == "" -a "$rvm_info" == "" ] && return From 28e2aeda4db35bfa58b9ccdcff87cf2c5d1eb5a1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 8 Jun 2011 11:57:16 -1000 Subject: [PATCH 20/43] Refactored theme to remove scm_info and rename overridden functions --- themes/hawaii50/hawaii50.theme.bash | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index a8e1de27..3dc77bc6 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -59,6 +59,9 @@ RVM_THEME_PROMPT_SUFFIX='' VIRTUALENV_THEME_PROMPT_PREFIX='' VIRTUALENV_THEME_PROMPT_SUFFIX='' +SCM_PROMPT_PREFIX=' on' +SCM_PROMPT_SUFFIX='' + # Max length of PWD to display MAX_PWD_LENGTH=20 @@ -94,17 +97,13 @@ function virtual_info() { } # SCM information -function scm_info() { - SCM_CHAR=$(scm_char) - [ "$SCM_CHAR" == "$SCM_NONE_CHAR" ] && return - local prompt=" on" - [ "$SCM_CHAR" == "$SCM_GIT_CHAR" ] && echo "$prompt$(parse_git_info)" && return - [ "$SCM_CHAR" == "$SCM_SVN_CHAR" ] && echo "$prompt$(parse_svn_info)" && return - [ "$SCM_CHAR" == "$SCM_HG_CHAR" ] && echo "$prompt$(parse_hg_info)" && return +function h50_scm_prompt_info() { + local scm_prompt=$(scm_prompt_info) + [[ -n "$scm_prompt" ]] && echo -e "$SCM_PROMPT_PREFIX$scm_prompt$SCM_PROMPT_SUFFIX" } # Parse git info -function parse_git_info() { +function git_prompt_info() { if [[ -n $(git status -s 2> /dev/null |grep -v ^# |grep -v "working directory clean") ]]; then state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else @@ -119,7 +118,7 @@ function parse_git_info() { } # Parse hg info -function parse_hg_info() { +function hg_prompt_info() { if [[ -n $(hg status 2> /dev/null) ]]; then state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else @@ -134,7 +133,7 @@ function parse_hg_info() { } # Parse svn info -function parse_svn_info() { +function svn_prompt_info() { if [[ -n $(svn status --ignore-externals -q 2> /dev/null) ]]; then state=${SVN_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else @@ -172,7 +171,7 @@ function prompt() { local UC=$USER_COLOR [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(scm_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(h50_scm_prompt_info) \$ " PS2='> ' PS4='+ ' } From 09bd0ef5d04660b33aa76ba96c916b3efe0032e8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 8 Jun 2011 13:34:27 -1000 Subject: [PATCH 21/43] Um, what was I thinking. Removed SCM_PROMPT_PREFIX and custom scm_info. (No need for it). --- themes/hawaii50/hawaii50.theme.bash | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 3dc77bc6..946b808c 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -50,7 +50,7 @@ REF_COLOR='\[${purple}\]' # SCM prompts SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' -SCM_THEME_PROMPT_PREFIX=' ' +SCM_THEME_PROMPT_PREFIX=' on ' SCM_THEME_PROMPT_SUFFIX='' RVM_THEME_PROMPT_PREFIX='' @@ -59,9 +59,6 @@ RVM_THEME_PROMPT_SUFFIX='' VIRTUALENV_THEME_PROMPT_PREFIX='' VIRTUALENV_THEME_PROMPT_SUFFIX='' -SCM_PROMPT_PREFIX=' on' -SCM_PROMPT_SUFFIX='' - # Max length of PWD to display MAX_PWD_LENGTH=20 @@ -96,12 +93,6 @@ function virtual_info() { echo "$prompt" } -# SCM information -function h50_scm_prompt_info() { - local scm_prompt=$(scm_prompt_info) - [[ -n "$scm_prompt" ]] && echo -e "$SCM_PROMPT_PREFIX$scm_prompt$SCM_PROMPT_SUFFIX" -} - # Parse git info function git_prompt_info() { if [[ -n $(git status -s 2> /dev/null |grep -v ^# |grep -v "working directory clean") ]]; then @@ -171,7 +162,7 @@ function prompt() { local UC=$USER_COLOR [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(h50_scm_prompt_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(scm_prompt_info) \$ " PS2='> ' PS4='+ ' } From b96345e00c64dc2be94275f3d1b6f298bf6af378 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Thu, 9 Jun 2011 12:18:11 -1000 Subject: [PATCH 22/43] Added VIRTUAL_PROMPT_ENABLED FLAG Added -e to echo to interpret \ Updated bash conditionals to use [[]] --- themes/hawaii50/hawaii50.theme.bash | 73 +++++++++++++++++------------ 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 946b808c..6202eb4d 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -53,12 +53,20 @@ SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' SCM_THEME_PROMPT_PREFIX=' on ' SCM_THEME_PROMPT_SUFFIX='' +# rvm prompts RVM_THEME_PROMPT_PREFIX='' RVM_THEME_PROMPT_SUFFIX='' +# virtualenv prompts VIRTUALENV_THEME_PROMPT_PREFIX='' VIRTUALENV_THEME_PROMPT_SUFFIX='' +# virtual prompts +VIRTUAL_PROMPT_ENABLED=1 + +VIRTUAL_THEME_PROMPT_PREFIX=' using ' +VIRTUAL_THEME_PROMPT_SUFFIX='' + # Max length of PWD to display MAX_PWD_LENGTH=20 @@ -69,72 +77,76 @@ MAX_GIT_HEX_LENGTH=5 # TODO: Should check with `uname` and use ip addr function ip { - echo $(ifconfig en1 | grep "inet " | awk '{ print $2 }') + echo -e $(ifconfig en1 | grep "inet " | awk '{ print $2 }') } -# Displays using ... -function virtual_info() { +# Displays virtual info prompt (virtualenv/rvm) +function virtual_prompt_info() { local virtual_env_info=$(virtualenv_prompt) local rvm_info=$(rvm_version_prompt) + local virtual_prompt="" + + local prefix=${VIRTUAL_THEME_PROMPT_PREFIX} + local suffix=${VIRTUAL_THEME_PROMPT_SUFFIX} # If no virtual info, just return - [ "$virtual_env_info" == "" -a "$rvm_info" == "" ] && return - - local prompt=" using" + [[ -z "$virtual_env_info" && -z "$rvm_info" ]] && return # If virtual_env info present, append to prompt - [ "$virtual_env_info" != "" ] && prompt="$prompt virtualenv: ${VE_COLOR}$virtual_env_info${DEFAULT_COLOR}" + [[ -n "$virtual_env_info" ]] && virtual_prompt="virtualenv: ${VE_COLOR}$virtual_env_info${DEFAULT_COLOR}" - if [ "$rvm_info" != "" ] + if [[ -n "$rvm_info" ]] then - [ "$virtual_env_info" != "" ] && prompt="$prompt," - prompt="$prompt rvm: ${RVM_COLOR}$rvm_info${DEFAULT_COLOR}" + [[ -n "$virtual_env_info" ]] && virtual_prompt="$virtual_prompt, " + virtual_prompt="${virtual_prompt}rvm: ${RVM_COLOR}$rvm_info${DEFAULT_COLOR}" fi - echo "$prompt" + echo -e "$prefix$virtual_prompt$suffix" } # Parse git info function git_prompt_info() { if [[ -n $(git status -s 2> /dev/null |grep -v ^# |grep -v "working directory clean") ]]; then - state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else - state=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + state=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} fi prefix=${GIT_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} suffix=${GIT_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} ref=$(git symbolic-ref HEAD 2> /dev/null) || return - rawhex=$(git rev-parse HEAD 2>/dev/null) || return + commit_id=$(git rev-parse HEAD 2>/dev/null) || return - echo "$prefix${REF_COLOR}${ref#refs/heads/}${DEFAULT_COLOR}:${rawhex:0:$MAX_GIT_HEX_LENGTH}$state$suffix" + echo -e "$prefix${REF_COLOR}${ref#refs/heads/}${DEFAULT_COLOR}:${commit_id:0:$MAX_GIT_HEX_LENGTH}$state$suffix" } # Parse hg info function hg_prompt_info() { if [[ -n $(hg status 2> /dev/null) ]]; then - state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else - state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} fi prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') - echo "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" + echo -e "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" } # Parse svn info function svn_prompt_info() { if [[ -n $(svn status --ignore-externals -q 2> /dev/null) ]]; then - state=${SVN_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + state=${SVN_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else - state=${SVN_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + state=${SVN_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} fi prefix=${SVN_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} suffix=${SVN_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} ref=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') || return - revision=$(svn info 2> /dev/null | sed -ne 's#^Revision: ##p' ) [[ -z $ref ]] && return + + revision=$(svn info 2> /dev/null | sed -ne 's#^Revision: ##p' ) + echo -e "$prefix${REF_COLOR}$ref${DEFAULT_COLOR}:$revision$state$suffix" } @@ -150,21 +162,24 @@ function limited_pwd() { then local truncated_symbol="..." TRUNCATED_PWD=${RELATIVE_PWD:$offset:$MAX_PWD_LENGTH} - echo "${truncated_symbol}/${TRUNCATED_PWD#*/}" + echo -e "${truncated_symbol}/${TRUNCATED_PWD#*/}" else - echo "${RELATIVE_PWD}" + echo -e "${RELATIVE_PWD}" fi } # Displays the current prompt function prompt() { + local UC=$USER_COLOR + [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - local UC=$USER_COLOR - [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR - - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_info)$(scm_prompt_info) \$ " - PS2='> ' - PS4='+ ' + if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info) \$ " + else + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info) \$ " + fi + PS2='> ' + PS4='+ ' } PROMPT_COMMAND=prompt From 49f897ae0def7ef26fe68570726cfb3804bb75c3 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Thu, 9 Jun 2011 13:20:41 -1000 Subject: [PATCH 23/43] Changed ip function to use bash-it's func, parsing out 127.0.0.1 Attached public facing ip address to list --- themes/hawaii50/hawaii50.theme.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 6202eb4d..a86821c0 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -73,11 +73,14 @@ MAX_PWD_LENGTH=20 # Max length of Git Hex to display MAX_GIT_HEX_LENGTH=5 +# IP address +IP_SEPARATOR=', ' + # FUNCS ======================================================================= -# TODO: Should check with `uname` and use ip addr function ip { - echo -e $(ifconfig en1 | grep "inet " | awk '{ print $2 }') + myip=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+') + echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}" } # Displays virtual info prompt (virtualenv/rvm) From ef42010c7b6468c18529820cb68bcc84747d79bd Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Sun, 12 Jun 2011 19:44:27 -0500 Subject: [PATCH 24/43] Make all aliases optional (a la plugins) This continues a pattern that was introduced in ffa45b0 and refined further in later commits. This enables all aliases by default, but can be disabled by any user if they remove the appropriate aliases/enabled/*.bash file. --- .gitignore | 1 + aliases/{ => available}/emacs.aliases.bash | 0 aliases/{ => available}/general.aliases.bash | 0 aliases/{ => available}/git.aliases.bash | 0 aliases/{ => available}/heroku.aliases.bash | 0 aliases/{ => available}/hg.aliases.bash | 0 aliases/{ => available}/jekyll.aliases.bash | 0 aliases/{ => available}/osx.aliases.bash | 0 aliases/{ => available}/rails.aliases.bash | 0 aliases/{ => available}/textmate.aliases.bash | 0 aliases/{ => available}/todo.txt-cli.aliases.bash | 0 aliases/{ => available}/vim.aliases.bash | 0 bash_it.sh | 7 ++++++- 13 files changed, 7 insertions(+), 1 deletion(-) rename aliases/{ => available}/emacs.aliases.bash (100%) rename aliases/{ => available}/general.aliases.bash (100%) rename aliases/{ => available}/git.aliases.bash (100%) rename aliases/{ => available}/heroku.aliases.bash (100%) rename aliases/{ => available}/hg.aliases.bash (100%) rename aliases/{ => available}/jekyll.aliases.bash (100%) rename aliases/{ => available}/osx.aliases.bash (100%) rename aliases/{ => available}/rails.aliases.bash (100%) rename aliases/{ => available}/textmate.aliases.bash (100%) rename aliases/{ => available}/todo.txt-cli.aliases.bash (100%) rename aliases/{ => available}/vim.aliases.bash (100%) diff --git a/.gitignore b/.gitignore index 6be7eefe..33e5fca9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +aliases/enabled plugins/enabled .DS_Store custom/*.bash diff --git a/aliases/emacs.aliases.bash b/aliases/available/emacs.aliases.bash similarity index 100% rename from aliases/emacs.aliases.bash rename to aliases/available/emacs.aliases.bash diff --git a/aliases/general.aliases.bash b/aliases/available/general.aliases.bash similarity index 100% rename from aliases/general.aliases.bash rename to aliases/available/general.aliases.bash diff --git a/aliases/git.aliases.bash b/aliases/available/git.aliases.bash similarity index 100% rename from aliases/git.aliases.bash rename to aliases/available/git.aliases.bash diff --git a/aliases/heroku.aliases.bash b/aliases/available/heroku.aliases.bash similarity index 100% rename from aliases/heroku.aliases.bash rename to aliases/available/heroku.aliases.bash diff --git a/aliases/hg.aliases.bash b/aliases/available/hg.aliases.bash similarity index 100% rename from aliases/hg.aliases.bash rename to aliases/available/hg.aliases.bash diff --git a/aliases/jekyll.aliases.bash b/aliases/available/jekyll.aliases.bash similarity index 100% rename from aliases/jekyll.aliases.bash rename to aliases/available/jekyll.aliases.bash diff --git a/aliases/osx.aliases.bash b/aliases/available/osx.aliases.bash similarity index 100% rename from aliases/osx.aliases.bash rename to aliases/available/osx.aliases.bash diff --git a/aliases/rails.aliases.bash b/aliases/available/rails.aliases.bash similarity index 100% rename from aliases/rails.aliases.bash rename to aliases/available/rails.aliases.bash diff --git a/aliases/textmate.aliases.bash b/aliases/available/textmate.aliases.bash similarity index 100% rename from aliases/textmate.aliases.bash rename to aliases/available/textmate.aliases.bash diff --git a/aliases/todo.txt-cli.aliases.bash b/aliases/available/todo.txt-cli.aliases.bash similarity index 100% rename from aliases/todo.txt-cli.aliases.bash rename to aliases/available/todo.txt-cli.aliases.bash diff --git a/aliases/vim.aliases.bash b/aliases/available/vim.aliases.bash similarity index 100% rename from aliases/vim.aliases.bash rename to aliases/available/vim.aliases.bash diff --git a/bash_it.sh b/bash_it.sh index d63458a0..1dde4503 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -37,7 +37,12 @@ do done # Aliases -FUNCTIONS="${BASH}/aliases/*.bash" +if [ ! -d "${BASH}/aliases/enabled" ] +then + mkdir "${BASH}/aliases/enabled" + ln -s ${BASH}/aliases/available/* "${BASH}/aliases/enabled" +fi +FUNCTIONS="${BASH}/aliases/enabled/*.bash" for config_file in $FUNCTIONS do source $config_file From 80e734f3e0d40b68adb13b4fb7397f69af0421ce Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 13 Jun 2011 11:45:24 -0500 Subject: [PATCH 25/43] Added Homebrew aliases to the available aliases --- aliases/{ => available}/homebrew.aliases.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename aliases/{ => available}/homebrew.aliases.bash (100%) diff --git a/aliases/homebrew.aliases.bash b/aliases/available/homebrew.aliases.bash similarity index 100% rename from aliases/homebrew.aliases.bash rename to aliases/available/homebrew.aliases.bash From 50179fd778081db95a5e316d401dad00af80ca79 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 13 Jun 2011 22:05:45 -0500 Subject: [PATCH 26/43] Can't forget to source the custom aliases! --- bash_it.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash_it.sh b/bash_it.sh index 1dde4503..3dd3d7a6 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -48,6 +48,8 @@ do source $config_file done +source "${BASH}/aliases/custom.aliases.bash" + # Custom CUSTOM="${BASH}/custom/*.bash" for config_file in $CUSTOM From 1f1ab36f37a9ce3bb84ad1396bc6e3de58f9fc2b Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 10:18:48 -0400 Subject: [PATCH 27/43] Add rainbowbrite theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like: ± ~/path/to (branch ✓) $ in glorious red / blue / yellow color scheme --- themes/rainbowbrite/rainbowbrite.theme.bash | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 themes/rainbowbrite/rainbowbrite.theme.bash diff --git a/themes/rainbowbrite/rainbowbrite.theme.bash b/themes/rainbowbrite/rainbowbrite.theme.bash new file mode 100644 index 00000000..c9d6f7e8 --- /dev/null +++ b/themes/rainbowbrite/rainbowbrite.theme.bash @@ -0,0 +1,28 @@ +#!/bin/bash + +# based off of n0qorg +# looks like, if you're in a git repo: +# ± ~/path/to (branch ✓) $ +# in glorious red / blue / yellow color scheme + +prompt_setter() { + # Save history + history -a + history -c + history -r + # displays user@server in purple + # PS1="\[$red\]$(scm_char) \[$purple\]\u@\h\[$reset_color\]:\[$blue\]\w\[$yellow\]$(scm_prompt_info)$(rvm_version_prompt) \[$black\]$\[$reset_color\] " + # no user@server + PS1="\[$red\]$(scm_char) \[$blue\]\w\[$yellow\]$(scm_prompt_info)$(rvm_version_prompt) \[$black\]$\[$reset_color\] " + PS2='> ' + PS4='+ ' +} + +PROMPT_COMMAND=prompt_setter + +SCM_THEME_PROMPT_DIRTY=" ✗" +SCM_THEME_PROMPT_CLEAN=" ✓" +SCM_THEME_PROMPT_PREFIX=" (" +SCM_THEME_PROMPT_SUFFIX=")" +RVM_THEME_PROMPT_PREFIX=" (" +RVM_THEME_PROMPT_SUFFIX=")" From 3dc46203205f89195d29be5cf079f2e31669e77d Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 10:24:04 -0400 Subject: [PATCH 28/43] SCM_NONE_CHAR='.' -> dot if no repo --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 70876622..c80290dc 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -15,7 +15,7 @@ SCM_HG_CHAR='☿' SVN='svn' SCM_SVN_CHAR='⑆' -SCM_NONE_CHAR='○' +SCM_NONE_CHAR='·' RVM_THEME_PROMPT_PREFIX=' |' RVM_THEME_PROMPT_SUFFIX='|' From fcf358169ff91ca3f10f96161b187e1a7227b93c Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 10:34:20 -0400 Subject: [PATCH 29/43] rainbowbrite theme : color branch status indicator --- themes/rainbowbrite/rainbowbrite.theme.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/rainbowbrite/rainbowbrite.theme.bash b/themes/rainbowbrite/rainbowbrite.theme.bash index c9d6f7e8..581fca4a 100644 --- a/themes/rainbowbrite/rainbowbrite.theme.bash +++ b/themes/rainbowbrite/rainbowbrite.theme.bash @@ -20,9 +20,9 @@ prompt_setter() { PROMPT_COMMAND=prompt_setter -SCM_THEME_PROMPT_DIRTY=" ✗" -SCM_THEME_PROMPT_CLEAN=" ✓" +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${green}✓" SCM_THEME_PROMPT_PREFIX=" (" -SCM_THEME_PROMPT_SUFFIX=")" +SCM_THEME_PROMPT_SUFFIX="${yellow})" RVM_THEME_PROMPT_PREFIX=" (" RVM_THEME_PROMPT_SUFFIX=")" From 3ef689f29a777f8a076b4a7032ca46f4ba331106 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 10:57:31 -0400 Subject: [PATCH 30/43] Add various aliases --- aliases/available/general.aliases.bash | 9 +++++++++ aliases/available/git.aliases.bash | 7 ++++++- aliases/available/jekyll.aliases.bash | 3 +++ aliases/available/osx.aliases.bash | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 79bd7aa0..2ed9d134 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -46,6 +46,15 @@ alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" alias md='mkdir -p' alias rd=rmdir +# show / hide hidden files +alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder" +alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder" +# display IP address +alias myip="echo ethernet:; ipconfig getifaddr en0; echo wireless:; ipconfig getifaddr en1" + +# http://snippets.dzone.com/posts/show/2486 +alias killsvn="find . -name ".svn" -type d -exec rm -rf {} \;" + function aliases-help() { echo "Generic Alias Usage" echo diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 45d7d05f..3a5d2a9f 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,7 +39,12 @@ case $OSTYPE in ;; esac - +# git add remote branch +function garb() { + echo "Adding remote branch '$1'"; + git config branch.$1.remote origin; + git config branch.$1.merge refs/heads/$1; +} function git-help() { echo "Git Custom Aliases Usage" diff --git a/aliases/available/jekyll.aliases.bash b/aliases/available/jekyll.aliases.bash index e52c0351..feaf245a 100644 --- a/aliases/available/jekyll.aliases.bash +++ b/aliases/available/jekyll.aliases.bash @@ -18,3 +18,6 @@ alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" # Rsync the site to the remote server alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" + +alias jkas="jekyll --auto --server" +alias rmjkas="rm -rf _site/* && jkas" \ No newline at end of file diff --git a/aliases/available/osx.aliases.bash b/aliases/available/osx.aliases.bash index e0746952..d25c0511 100644 --- a/aliases/available/osx.aliases.bash +++ b/aliases/available/osx.aliases.bash @@ -14,6 +14,7 @@ alias dashcode="open -a dashcode" alias f='open -a Finder ' alias textedit='open -a TextEdit' alias hex='open -a "Hex Fiend"' +alias gitx="open -a GitX" if [ -s /usr/bin/firefox ] ; then unalias firefox From d22a4cfa7058b224e37dbf07aa7cd3c583fdd188 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 11:01:18 -0400 Subject: [PATCH 31/43] move garb into git plugins; rename newpost as jknewpost --- aliases/available/git.aliases.bash | 7 ------- plugins/available/git.plugins.bash | 8 +++++++- plugins/available/jekyll.plugins.bash | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 3a5d2a9f..7cfc9d93 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,13 +39,6 @@ case $OSTYPE in ;; esac -# git add remote branch -function garb() { - echo "Adding remote branch '$1'"; - git config branch.$1.remote origin; - git config branch.$1.merge refs/heads/$1; -} - function git-help() { echo "Git Custom Aliases Usage" echo diff --git a/plugins/available/git.plugins.bash b/plugins/available/git.plugins.bash index b0b9ce8c..3fbdac61 100644 --- a/plugins/available/git.plugins.bash +++ b/plugins/available/git.plugins.bash @@ -5,6 +5,13 @@ function git_remote { git remote add origin $GIT_HOSTING:$1.git } +# git add remote branch +function garb() { + echo "Adding remote branch '$1'"; + git config branch.$1.remote origin; + git config branch.$1.merge refs/heads/$1; +} + function git_first_push { echo "Running: git push origin master:refs/heads/master" git push origin master:refs/heads/master @@ -92,4 +99,3 @@ else echo "you're currently not in a git repository" fi } - diff --git a/plugins/available/jekyll.plugins.bash b/plugins/available/jekyll.plugins.bash index aebe69bc..3b96f451 100644 --- a/plugins/available/jekyll.plugins.bash +++ b/plugins/available/jekyll.plugins.bash @@ -26,7 +26,7 @@ editpost() { fi } -newpost() { +jknewpost() { # 'builtin cd' into the local jekyll root From 78270b3ab570e1806673a12a7f4f58c3eb029b09 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 17 Jun 2011 11:22:39 -0500 Subject: [PATCH 32/43] Make sure custom aliases file exists before sourcing it --- bash_it.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash_it.sh b/bash_it.sh index 3dd3d7a6..b52ff97f 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -48,7 +48,10 @@ do source $config_file done -source "${BASH}/aliases/custom.aliases.bash" +if [ -e "${BASH}/aliases/custom.aliases.bash" ] +then + source "${BASH}/aliases/custom.aliases.bash" +fi # Custom CUSTOM="${BASH}/custom/*.bash" From 46b8d27815583c1b79ef9f0b27f9b39680baa114 Mon Sep 17 00:00:00 2001 From: JFSIII Date: Fri, 17 Jun 2011 14:58:20 -0400 Subject: [PATCH 33/43] Change color definitions so they don't require escaping in the themes. When do you ever want those unprintable characters included in the character count? --- themes/colors.theme.bash | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/themes/colors.theme.bash b/themes/colors.theme.bash index 9aa253f5..ff8776d2 100644 --- a/themes/colors.theme.bash +++ b/themes/colors.theme.bash @@ -1,44 +1,44 @@ #!/bin/bash -black=$'\e[0;30m' -red=$'\e[0;31m' -green=$'\e[0;32m' -yellow=$'\e[0;33m' -blue=$'\e[0;34m' -purple=$'\e[0;35m' -cyan=$'\e[0;36m' -white=$'\e[1;37m' -orange=$'\e[33;40m' +black="\[\e[0;30m\]" +red="\[\e[0;31m\]" +green="\[\e[0;32m\]" +yellow="\[\e[0;33m\]" +blue="\[\e[0;34m\]" +purple="\[\e[0;35m\]" +cyan="\[\e[0;36m\]" +white="\[\e[1;37m\]" +orange="\[\e[33;40m\]" -bold_black=$'\e[1;30m' -bold_red=$'\e[1;31m' -bold_green=$'\e[1;32m' -bold_yellow=$'\e[1;33m' -bold_blue=$'\e[1;34m' -bold_purple=$'\e[1;35m' -bold_cyan=$'\e[1;36m' -bold_white=$'\e[1;37m' -bold_orange=$'\e[1;33;40m' +bold_black="\[\e[1;30m\]" +bold_red="\[\e[1;31m\]" +bold_green="\[\e[1;32m\]" +bold_yellow="\[\e[1;33m\]" +bold_blue="\[\e[1;34m\]" +bold_purple="\[\e[1;35m\]" +bold_cyan="\[\e[1;36m\]" +bold_white="\[\e[1;37m\]" +bold_orange="\[\e[1;33;40m\]" -underline_black=$'\e[4;30m' -underline_red=$'\e[4;31m' -underline_green=$'\e[4;32m' -underline_yellow=$'\e[4;33m' -underline_blue=$'\e[4;34m' -underline_purple=$'\e[4;35m' -underline_cyan=$'\e[4;36m' -underline_white=$'\e[4;37m' -underline_orange=$'\e[4;33;40m' +underline_black="\[\e[4;30m\]" +underline_red="\[\e[4;31m\]" +underline_green="\[\e[4;32m\]" +underline_yellow="\[\e[4;33m\]" +underline_blue="\[\e[4;34m\]" +underline_purple="\[\e[4;35m\]" +underline_cyan="\[\e[4;36m\]" +underline_white="\[\e[4;37m\]" +underline_orange="\[\e[4;33;40m\]" -background_black=$'\e[40m' -background_red=$'\e[41m' -background_green=$'\e[42m' -background_yellow=$'\e[43m' -background_blue=$'\e[44m' -background_purple=$'\e[45m' -background_cyan=$'\e[46m' -background_white=$'\e[47m' +background_black="\[\e[40m\]" +background_red="\[\e[41m\]" +background_green="\[\e[42m\]" +background_yellow="\[\e[43m\]" +background_blue="\[\e[44m\]" +background_purple="\[\e[45m\]" +background_cyan="\[\e[46m\]" +background_white="\[\e[47m\]" -normal=$'\e[00m' -reset_color=$'\e[39m' \ No newline at end of file +normal="\[\e[00m\]" +reset_color="\[\e[39m\]" From 8e1107730dca1bf88d022782d9eacabbb4651e89 Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Fri, 17 Jun 2011 10:31:49 -1000 Subject: [PATCH 34/43] Needed to escape colors correctly for line wrapping to occur. Removed extraneous DEFAULT_COLOR in prompt --- themes/hawaii50/hawaii50.theme.bash | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index a86821c0..ad87e787 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -31,8 +31,7 @@ # # COLORS ====================================================================== -ORANGE='\e[0;33m' -GREY='\e[1:37m' +ORANGE='\[\e[0;33m\]' DEFAULT_COLOR='\[${white}\]' @@ -48,8 +47,8 @@ RVM_COLOR='\[${cyan}\]' REF_COLOR='\[${purple}\]' # SCM prompts -SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' -SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' +SCM_THEME_PROMPT_DIRTY=' \[${bold_red}\]✗\[${normal}\]' +SCM_THEME_PROMPT_CLEAN=' \[${bold_green}\]✓\[${normal}\]' SCM_THEME_PROMPT_PREFIX=' on ' SCM_THEME_PROMPT_SUFFIX='' @@ -177,9 +176,9 @@ function prompt() { [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info) \$ " else - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})${DEFAULT_COLOR} in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info) \$ " fi PS2='> ' PS4='+ ' From bb990313252a8dc95dbb5d58ca7bf5dd83ad402b Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Fri, 17 Jun 2011 14:38:49 -0700 Subject: [PATCH 35/43] Added "hg_prompt_info" to base theme - it is used by scm_prompt_info --- themes/base.theme.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index d6be1544..71b11aeb 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -82,6 +82,20 @@ function svn_prompt_info { echo -e "$prefix$ref$state$suffix" } +function hg_prompt_info() { + if [[ -n $(hg status 2> /dev/null) ]]; then + state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') + changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') + + echo -e "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" +} + function rvm_version_prompt { if which rvm &> /dev/null; then rvm=$(rvm tools identifier) || return From 1b7c9419bf1a2474f2d819f9aa07687cb4d8fd1d Mon Sep 17 00:00:00 2001 From: JFSIII Date: Fri, 17 Jun 2011 19:45:21 -0400 Subject: [PATCH 36/43] Convert themes and plugins to use the update colors. Themes are no longer burdened with escaping the unprintable characters --- plugins/available/battery.plugin.bash | 12 +++++----- themes/bobby/bobby.theme.bash | 15 +++++------- themes/candy/candy.theme.bash | 6 ++++- themes/clean/clean.theme.bash | 18 ++++++++------ themes/demula/demula.theme.bash | 32 ++++++++++++------------- themes/doubletime/doubletime.theme.bash | 12 +++++----- themes/modern-t/modern-t.theme.bash | 10 ++++---- themes/modern/modern.theme.bash | 10 ++++---- themes/n0qorg/n0qorg.theme.bash | 6 ++++- themes/pete/pete.theme.bash | 2 +- themes/sirup/sirup.theme.bash | 8 +++++-- themes/standard/standard.theme.bash | 12 ++++++---- themes/zitron/zitron.theme.bash | 16 ++++++++----- themes/zork/zork.theme.bash | 10 ++++---- 14 files changed, 94 insertions(+), 75 deletions(-) diff --git a/plugins/available/battery.plugin.bash b/plugins/available/battery.plugin.bash index 4946c2c9..7c158122 100644 --- a/plugins/available/battery.plugin.bash +++ b/plugins/available/battery.plugin.bash @@ -69,11 +69,11 @@ battery_charge(){ local F_C='▸' # Depleted char local D_C='▹' - local DEPLETED_COLOR='\[${normal}\]' - local FULL_COLOR='\[${green}\]' - local HALF_COLOR='\[${yellow}\]' - local DANGER_COLOR='\[${red}\]' - local BATTERY_OUTPUT='${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${D_C}' + local DEPLETED_COLOR="${normal}" + local FULL_COLOR="${green}" + local HALF_COLOR="${yellow}" + local DANGER_COLOR="${red}" + local BATTERY_OUTPUT="${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${D_C}" local BATTERY_PERC=$(battery_percentage) case $BATTERY_PERC in @@ -123,7 +123,7 @@ battery_charge(){ echo "${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}" ;; *) - echo "${DANGER_COLOR}UNPLG\[${normal}\]" + echo "${DANGER_COLOR}UNPLG${normal}" ;; esac } diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index 8b48ddd9..cb51fb85 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -4,15 +4,6 @@ SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" SCM_THEME_PROMPT_PREFIX=" |" SCM_THEME_PROMPT_SUFFIX="${green}|" - -# PROMPT="\[${bold_cyan}\]\[\$(scm_char)\]\[${green}\]\[\$(scm_prompt_info)\]\[${purple}\]\[\$(rvm_version_prompt)\] \[${yellow}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[\n\[${green}\]→\[${reset_color}\] " - - -PROMPT="\n\[${yellow}\]\[\$(rvm_version_prompt)\] \[${purple}\]\h \[${reset_color}\]in \[${green}\]\w\n\[${bold_cyan}\]\[\$(scm_char)\]\[${green}\]\[\$(scm_prompt_info)\] \[\[${green}\]→\[${reset_color}\] " - - - -# git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" GIT_THEME_PROMPT_PREFIX=" ${green}|" @@ -21,3 +12,9 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" +function prompt_command() { + #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(rvm_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " + PS1="\n${yellow}$(rvm_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " +} + +PROMPT_COMMAND=prompt_command; diff --git a/themes/candy/candy.theme.bash b/themes/candy/candy.theme.bash index ef0ba262..64d31b83 100644 --- a/themes/candy/candy.theme.bash +++ b/themes/candy/candy.theme.bash @@ -1,2 +1,6 @@ #!/bin/bash -PROMPT="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}\[\$(scm_prompt_info)\]${blue} →${bold_blue} \$${reset_color} " \ No newline at end of file +function prompt_command() { + PS1="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}$(scm_prompt_info)\]${blue} →${bold_blue} ${reset_color} "; +} + +PROMPT_COMMAND=prompt_command; diff --git a/themes/clean/clean.theme.bash b/themes/clean/clean.theme.bash index 2fc418f8..9998d65e 100644 --- a/themes/clean/clean.theme.bash +++ b/themes/clean/clean.theme.bash @@ -1,9 +1,3 @@ -if [ "$(whoami)" = root ]; then no_color=$red; else no_color=$white; fi - -PROMPT="${no_color}\u${reset_color}:${blue}\W/${reset_color} \[\$(scm_prompt_info)\]$ " -RPROMPT='[\t]' - - # git theming ZSH_THEME_GIT_PROMPT_PREFIX="${bold_blue}(${yellow}%B" ZSH_THEME_GIT_PROMPT_SUFFIX="%b${bold_blue})${reset_color} " @@ -13,4 +7,14 @@ ZSH_THEME_GIT_PROMPT_DIRTY="${bold_red}✗" # LS colors, made with http://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' + +function prompt_command() { + + if [ "$(whoami)" = root ]; then no_color=$red; else no_color=$white; fi + + PS1="${no_color}\u${reset_color}:${blue}\W/${reset_color} \[\$(scm_prompt_info)\]$ " + RPROMPT='[\t]' +} + +PROMPT_COMMAND=prompt_command; diff --git a/themes/demula/demula.theme.bash b/themes/demula/demula.theme.bash index 0e6744a4..bd48e12c 100644 --- a/themes/demula/demula.theme.bash +++ b/themes/demula/demula.theme.bash @@ -33,22 +33,22 @@ #*color7: #E5E5E5 # ----------------------------------------------------------------- COLOR CONF -D_DEFAULT_COLOR='\[${normal}\]' -D_INTERMEDIATE_COLOR='\[${white}\]' -D_USER_COLOR='\[${purple}\]' -D_SUPERUSER_COLOR='\[${red}\]' -D_MACHINE_COLOR='\[${cyan}\]' -D_DIR_COLOR='\[${green}\]' -D_SCM_COLOR='\[${yellow}\]' -D_BRANCH_COLOR='\[${yellow}\]' -D_CHANGES_COLOR='\[${white}\]' -D_CMDFAIL_COLOR='\[${red}\]' -D_VIMSHELL_COLOR='\[${cyan}\]' +D_DEFAULT_COLOR="${normal}" +D_INTERMEDIATE_COLOR="${white}" +D_USER_COLOR="${purple}" +D_SUPERUSER_COLOR="${red}" +D_MACHINE_COLOR="${cyan}" +D_DIR_COLOR="${green}" +D_SCM_COLOR="${yellow}" +D_BRANCH_COLOR="${yellow}" +D_CHANGES_COLOR="${white}" +D_CMDFAIL_COLOR="${red}" +D_VIMSHELL_COLOR="${cyan}" # ------------------------------------------------------------------ FUNCTIONS case $TERM in xterm*) - TITLEBAR="\[\033]0;\w\007\]" + TITLEBAR="\033]0;\w\007" ;; *) TITLEBAR="" @@ -84,10 +84,10 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" # -------------------------------------------------------------- PROMPT OUTPUT prompt() { - local SAVE_CURSOR='\[\033[s\]' - local RESTORE_CURSOR='\[\033[u\]' - local MOVE_CURSOR_RIGHTMOST='\[\033[500C\]' - local MOVE_CURSOR_5_LEFT='\[\033[5D\]' + local SAVE_CURSOR='\033[s' + local RESTORE_CURSOR='\033[u' + local MOVE_CURSOR_RIGHTMOST='\033[500C' + local MOVE_CURSOR_5_LEFT='\033[5D' if [ $(uname) = "Linux" ]; then diff --git a/themes/doubletime/doubletime.theme.bash b/themes/doubletime/doubletime.theme.bash index 91844f0e..1237f80f 100644 --- a/themes/doubletime/doubletime.theme.bash +++ b/themes/doubletime/doubletime.theme.bash @@ -1,9 +1,9 @@ #!/bin/bash SCM_THEME_PROMPT_DIRTY='' SCM_THEME_PROMPT_CLEAN='' -SCM_GIT_CHAR='${bold_cyan}±${normal}' -SCM_SVN_CHAR='${bold_cyan}⑆${normal}' -SCM_HG_CHAR='${bold_red}☿${normal}' +SCM_GIT_CHAR="${bold_cyan}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" RVM_THEME_PROMPT_PREFIX=" (" @@ -32,7 +32,7 @@ virtualenv_prompt() { fi } -prompt_setter() { +function prompt_setter() { # Save history history -a history -c @@ -44,8 +44,8 @@ prompt_setter() { clock=$THEME_PROMPT_CLOCK_FORMAT fi PS1=" -$clock $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] $(virtualenv_prompt)\w -$(doubletime_scm_prompt)\[$reset_color\] $ " +$clock $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}$reset_color] $(virtualenv_prompt)\w +$(doubletime_scm_prompt)$reset_color $ " PS2='> ' PS4='+ ' } diff --git a/themes/modern-t/modern-t.theme.bash b/themes/modern-t/modern-t.theme.bash index 55da6e14..12e5b041 100644 --- a/themes/modern-t/modern-t.theme.bash +++ b/themes/modern-t/modern-t.theme.bash @@ -1,11 +1,11 @@ SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' -SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' -SCM_GIT_CHAR='${bold_green}±${normal}' -SCM_SVN_CHAR='${bold_cyan}⑆${normal}' -SCM_HG_CHAR='${bold_red}☿${normal}' +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_GIT_CHAR="${bold_green}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" case $TERM in xterm*) diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 3efe9ffe..32c7cabb 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -1,11 +1,11 @@ SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' -SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' -SCM_GIT_CHAR='${bold_green}±${normal}' -SCM_SVN_CHAR='${bold_cyan}⑆${normal}' -SCM_HG_CHAR='${bold_red}☿${normal}' +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_GIT_CHAR="${bold_green}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" case $TERM in xterm*) diff --git a/themes/n0qorg/n0qorg.theme.bash b/themes/n0qorg/n0qorg.theme.bash index fcaca43f..2b9def6c 100644 --- a/themes/n0qorg/n0qorg.theme.bash +++ b/themes/n0qorg/n0qorg.theme.bash @@ -5,7 +5,11 @@ # host directory (branch*)» # for example: # ananas ~/Code/bash-it/themes (master*)» -PROMPT="${bold_blue}\[\$(hostname)\]${normal} \w${normal} ${bold_white}\[\$(git_prompt_info)\]${normal}» " +function prompt_command() { + PS1="${bold_blue}[$(hostname)]${normal} \w${normal} ${bold_white}[$(git_prompt_info)]${normal}» " +} + +PROMPT_COMMAND=prompt_command; ## git-theme # feel free to change git chars. diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash index 95f243af..7b6702cf 100644 --- a/themes/pete/pete.theme.bash +++ b/themes/pete/pete.theme.bash @@ -5,7 +5,7 @@ prompt_setter() { history -a history -c history -r - PS1="(\t) $(scm_char) [\[$blue\]\u\[$reset_color\]@\[$green\]\H\[$reset_color\]] \[$yellow\]\w\[$reset_color\]$(scm_prompt_info)$(rvm_version_prompt) $\[$reset_color\] " + PS1="(\t) $(scm_char) [$blue\u$reset_color@$green\H$reset_color] $yellow\w${reset_color}$(scm_prompt_info)$(rvm_version_prompt) $reset_color " PS2='> ' PS4='+ ' } diff --git a/themes/sirup/sirup.theme.bash b/themes/sirup/sirup.theme.bash index 50665871..146cc356 100644 --- a/themes/sirup/sirup.theme.bash +++ b/themes/sirup/sirup.theme.bash @@ -13,6 +13,10 @@ function rvm_version_prompt { [ "$full" != "" ] && echo "$full" } + +function prompt_command() { + # Check http://github.com/Sirupsen/dotfiles for screenshot + PS1="$blue\W/$bold_blue$(rvm_version_prompt)$bold_green$(__git_ps1 " (%s)") ${normal}$ " +} -# Check http://github.com/Sirupsen/dotfiles for screenshot -PS1='\[$blue\]\W/\[$bold_blue\]$(rvm_version_prompt)\[$bold_green\]$(__git_ps1 " (%s)") \[${normal}\]$ ' +PROMPT_COMMAND=prompt_command; diff --git a/themes/standard/standard.theme.bash b/themes/standard/standard.theme.bash index 5ba288c1..87402c73 100644 --- a/themes/standard/standard.theme.bash +++ b/themes/standard/standard.theme.bash @@ -1,7 +1,3 @@ -PROMPT='\[${green}\]\u\[${normal}\]@\[${green}\]\h\[${normal}\]:\[${blue}\]\w\[${normal}\]\[${red}\]$(prompt_char)$(git_prompt_info)\[${normal}\]\$ ' - - - # scm themeing SCM_THEME_PROMPT_DIRTY="×" SCM_THEME_PROMPT_CLEAN="✓" @@ -19,4 +15,10 @@ case $TERM in *) TITLEBAR="" ;; -esac \ No newline at end of file +esac + +function prompt_command() { + PROMPT='${green}\u${normal}@${green}\h${normal}:${blue}\w${normal}${red}$(prompt_char)$(git_prompt_info)${normal}\$ ' +} + +PROMPT_COMMAND=prompt_command; diff --git a/themes/zitron/zitron.theme.bash b/themes/zitron/zitron.theme.bash index c0726865..3ec4d97a 100644 --- a/themes/zitron/zitron.theme.bash +++ b/themes/zitron/zitron.theme.bash @@ -1,12 +1,6 @@ #!/bin/bash # zitron theme by Florian Baumann -## look-a-like -# user:host:pwd git-branch(*)$ -# for example: -# noqqe:deathstar:themes master*$ -PROMPT="${no_color}\u:\[\$(hostname)\]${normal}:${bold_yellow}\W/${normal} \[\$(git_prompt_info)\]${reset_color}$ " - ## git-theme # feel free to change git chars. GIT_THEME_PROMPT_DIRTY="${bold_yellow}*${normal}" @@ -18,3 +12,13 @@ GIT_THEME_PROMPT_SUFFIX="" # thanks a lot to http://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" export LS_COLORS="no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;34:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:" + +function prompt_command() { + ## look-a-like + # user:host:pwd git-branch(*)$ + # for example: + # noqqe:deathstar:themes master*$ + PS1="${no_color}\u:$(hostname)${normal}:${bold_yellow}\W/${normal} $(git_prompt_info)${reset_color}$ " +} + +PROMPT_COMMAND=prompt_command; diff --git a/themes/zork/zork.theme.bash b/themes/zork/zork.theme.bash index 54615d78..f541c0d9 100644 --- a/themes/zork/zork.theme.bash +++ b/themes/zork/zork.theme.bash @@ -1,11 +1,11 @@ SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" -SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' -SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' -SCM_GIT_CHAR='${bold_green}±${normal}' -SCM_SVN_CHAR='${bold_cyan}⑆${normal}' -SCM_HG_CHAR='${bold_red}☿${normal}' +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_GIT_CHAR="${bold_green}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" #Mysql Prompt export MYSQL_PS1="(\u@\h) [\d]> " From 8b380c191451afd1d2211c9c0738e5c8058899be Mon Sep 17 00:00:00 2001 From: JFSIII Date: Sat, 18 Jun 2011 10:57:59 -0400 Subject: [PATCH 37/43] Convert theme to use the already escaped colors introduced in 46b8d27815583c1b79ef9f0b27f9b39680baa114 --- themes/hawaii50/hawaii50.theme.bash | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index ad87e787..9ee1f6eb 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -33,22 +33,22 @@ # COLORS ====================================================================== ORANGE='\[\e[0;33m\]' -DEFAULT_COLOR='\[${white}\]' +DEFAULT_COLOR="${white}" -USER_COLOR='\[${purple}\]' -SUPERUSER_COLOR='\[${red}\]' +USER_COLOR="${purple}" +SUPERUSER_COLOR="${red}" MACHINE_COLOR=$ORANGE IP_COLOR=$ORANGE -DIRECTORY_COLOR='\[${green}\]' +DIRECTORY_COLOR="${green}" -VE_COLOR='\[${cyan}\]' -RVM_COLOR='\[${cyan}\]' +VE_COLOR="${cyan}" +RVM_COLOR="${cyan}" -REF_COLOR='\[${purple}\]' +REF_COLOR="${purple}" # SCM prompts -SCM_THEME_PROMPT_DIRTY=' \[${bold_red}\]✗\[${normal}\]' -SCM_THEME_PROMPT_CLEAN=' \[${bold_green}\]✓\[${normal}\]' +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" SCM_THEME_PROMPT_PREFIX=' on ' SCM_THEME_PROMPT_SUFFIX='' From 59f7a188a7c855e5f27bb6b11f8d81a2b97c644a Mon Sep 17 00:00:00 2001 From: JFSIII Date: Sat, 18 Jun 2011 11:04:01 -0400 Subject: [PATCH 38/43] Add `${reset_color}` at the end of `PS1` to prevent color from bleeding --- themes/hawaii50/hawaii50.theme.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 9ee1f6eb..21c0b413 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -176,9 +176,9 @@ function prompt() { [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color} \$ " else - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info) \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color} \$ " fi PS2='> ' PS4='+ ' From 4219db7affac90c46de0848a6b98984147061cdb Mon Sep 17 00:00:00 2001 From: JFSIII Date: Sat, 18 Jun 2011 11:23:26 -0400 Subject: [PATCH 39/43] Update theme to use the already escaped colors added in 46b8d27815583c1b79ef9f0b27f9b39680baa114 --- themes/rainbowbrite/rainbowbrite.theme.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/rainbowbrite/rainbowbrite.theme.bash b/themes/rainbowbrite/rainbowbrite.theme.bash index 581fca4a..5f91705c 100644 --- a/themes/rainbowbrite/rainbowbrite.theme.bash +++ b/themes/rainbowbrite/rainbowbrite.theme.bash @@ -11,9 +11,9 @@ prompt_setter() { history -c history -r # displays user@server in purple - # PS1="\[$red\]$(scm_char) \[$purple\]\u@\h\[$reset_color\]:\[$blue\]\w\[$yellow\]$(scm_prompt_info)$(rvm_version_prompt) \[$black\]$\[$reset_color\] " + # PS1="$red$(scm_char) $purple\u@\h$reset_color:$blue\w$yellow$(scm_prompt_info)$(rvm_version_prompt) $black\$$reset_color " # no user@server - PS1="\[$red\]$(scm_char) \[$blue\]\w\[$yellow\]$(scm_prompt_info)$(rvm_version_prompt) \[$black\]$\[$reset_color\] " + PS1="$red$(scm_char) $blue\w$yellow$(scm_prompt_info)$(rvm_version_prompt) $black\$$reset_color " PS2='> ' PS4='+ ' } From ccab485f742536bfdf109ffd97c24d064d92d697 Mon Sep 17 00:00:00 2001 From: JFSIII Date: Sat, 18 Jun 2011 11:55:22 -0400 Subject: [PATCH 40/43] Reverting alterations introduced in 3dc46203205f89195d29be5cf079f2e31669e77d Moved SCM_NON_CHAR change to theme since it is theme-specific and shouldn't affect all themes. --- themes/base.theme.bash | 2 +- themes/rainbowbrite/rainbowbrite.theme.bash | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index bd29a424..71b11aeb 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -15,7 +15,7 @@ SCM_HG_CHAR='☿' SVN='svn' SCM_SVN_CHAR='⑆' -SCM_NONE_CHAR='·' +SCM_NONE_CHAR='○' RVM_THEME_PROMPT_PREFIX=' |' RVM_THEME_PROMPT_SUFFIX='|' diff --git a/themes/rainbowbrite/rainbowbrite.theme.bash b/themes/rainbowbrite/rainbowbrite.theme.bash index 5f91705c..e4424bbe 100644 --- a/themes/rainbowbrite/rainbowbrite.theme.bash +++ b/themes/rainbowbrite/rainbowbrite.theme.bash @@ -20,6 +20,7 @@ prompt_setter() { PROMPT_COMMAND=prompt_setter +SCM_NONE_CHAR='·' SCM_THEME_PROMPT_DIRTY=" ${red}✗" SCM_THEME_PROMPT_CLEAN=" ${green}✓" SCM_THEME_PROMPT_PREFIX=" (" From 758c57621a59f4e3b8344faaae39bf00bcee107a Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Sat, 18 Jun 2011 10:07:26 -1000 Subject: [PATCH 41/43] Removed variables specific to hawaii50 theme :) --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 71b11aeb..feee64e8 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -93,7 +93,7 @@ function hg_prompt_info() { branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') - echo -e "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" + echo -e "$prefix$branch:${changeset#*:}$state$suffix" } function rvm_version_prompt { From 11b595516167927b70d182ab8d38257c9e86cfc3 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 16:13:34 -0400 Subject: [PATCH 42/43] Revert "move garb into git plugins; rename newpost as jknewpost" This reverts commit d22a4cfa7058b224e37dbf07aa7cd3c583fdd188. --- aliases/available/git.aliases.bash | 7 +++++++ plugins/available/git.plugins.bash | 8 +------- plugins/available/jekyll.plugins.bash | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 7cfc9d93..3a5d2a9f 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,6 +39,13 @@ case $OSTYPE in ;; esac +# git add remote branch +function garb() { + echo "Adding remote branch '$1'"; + git config branch.$1.remote origin; + git config branch.$1.merge refs/heads/$1; +} + function git-help() { echo "Git Custom Aliases Usage" echo diff --git a/plugins/available/git.plugins.bash b/plugins/available/git.plugins.bash index 3fbdac61..b0b9ce8c 100644 --- a/plugins/available/git.plugins.bash +++ b/plugins/available/git.plugins.bash @@ -5,13 +5,6 @@ function git_remote { git remote add origin $GIT_HOSTING:$1.git } -# git add remote branch -function garb() { - echo "Adding remote branch '$1'"; - git config branch.$1.remote origin; - git config branch.$1.merge refs/heads/$1; -} - function git_first_push { echo "Running: git push origin master:refs/heads/master" git push origin master:refs/heads/master @@ -99,3 +92,4 @@ else echo "you're currently not in a git repository" fi } + diff --git a/plugins/available/jekyll.plugins.bash b/plugins/available/jekyll.plugins.bash index 3b96f451..aebe69bc 100644 --- a/plugins/available/jekyll.plugins.bash +++ b/plugins/available/jekyll.plugins.bash @@ -26,7 +26,7 @@ editpost() { fi } -jknewpost() { +newpost() { # 'builtin cd' into the local jekyll root From 4a8e08e7832fe4480ca4bf9db7a7778dc0478400 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 16:13:59 -0400 Subject: [PATCH 43/43] Revert "Add various aliases" This reverts commit 3ef689f29a777f8a076b4a7032ca46f4ba331106. --- aliases/available/general.aliases.bash | 9 --------- aliases/available/git.aliases.bash | 7 +------ aliases/available/jekyll.aliases.bash | 3 --- aliases/available/osx.aliases.bash | 1 - 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 2ed9d134..79bd7aa0 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -46,15 +46,6 @@ alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" alias md='mkdir -p' alias rd=rmdir -# show / hide hidden files -alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder" -alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder" -# display IP address -alias myip="echo ethernet:; ipconfig getifaddr en0; echo wireless:; ipconfig getifaddr en1" - -# http://snippets.dzone.com/posts/show/2486 -alias killsvn="find . -name ".svn" -type d -exec rm -rf {} \;" - function aliases-help() { echo "Generic Alias Usage" echo diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 3a5d2a9f..45d7d05f 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,12 +39,7 @@ case $OSTYPE in ;; esac -# git add remote branch -function garb() { - echo "Adding remote branch '$1'"; - git config branch.$1.remote origin; - git config branch.$1.merge refs/heads/$1; -} + function git-help() { echo "Git Custom Aliases Usage" diff --git a/aliases/available/jekyll.aliases.bash b/aliases/available/jekyll.aliases.bash index feaf245a..e52c0351 100644 --- a/aliases/available/jekyll.aliases.bash +++ b/aliases/available/jekyll.aliases.bash @@ -18,6 +18,3 @@ alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" # Rsync the site to the remote server alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" - -alias jkas="jekyll --auto --server" -alias rmjkas="rm -rf _site/* && jkas" \ No newline at end of file diff --git a/aliases/available/osx.aliases.bash b/aliases/available/osx.aliases.bash index d25c0511..e0746952 100644 --- a/aliases/available/osx.aliases.bash +++ b/aliases/available/osx.aliases.bash @@ -14,7 +14,6 @@ alias dashcode="open -a dashcode" alias f='open -a Finder ' alias textedit='open -a TextEdit' alias hex='open -a "Hex Fiend"' -alias gitx="open -a GitX" if [ -s /usr/bin/firefox ] ; then unalias firefox