Added demula theme
authorJesus de Mula Cano <demula@gmail.com>
Fri, 4 Mar 2011 10:44:56 +0000 (11:44 +0100)
committerJesus de Mula Cano <demula@gmail.com>
Fri, 4 Mar 2011 10:44:56 +0000 (11:44 +0100)
themes/demula/demula.theme.bash [new file with mode: 0644]

diff --git a/themes/demula/demula.theme.bash b/themes/demula/demula.theme.bash
new file mode 100644 (file)
index 0000000..33396d9
--- /dev/null
@@ -0,0 +1,60 @@
+# ------------------------------------------------------------------ COLOR CONF
+D_DEFAULT_COLOR='${gray}'
+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}'
+
+case $TERM in
+       xterm*)
+       TITLEBAR="\[\033]0;\w\007\]"
+       ;;
+       *)
+       TITLEBAR=""
+       ;;
+esac
+
+PS3=">> "
+
+is_vim_shell() {
+       if [ ! -z "$VIMRUNTIME" ]
+       then
+               echo "on ${cyan}vim shell${white} "
+       fi
+}
+
+mitsuhikos_lastcommandfailed() {
+  code=$?
+  if [ $code != 0 ]; then
+    echo -n '\[${white}\]exited \[${red}\]'
+    echo -n $code
+    echo -n '\[${white}\] '
+  fi
+}
+
+D_VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
+D_VCPROMPT_FORMAT="on ${D_SCM_COLOR}%s${white}:${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${white}"
+demula_vcprompt() {
+        $D_VCPROMPT_EXECUTABLE -f "$D_VCPROMPT_FORMAT" 
+}
+
+prompt() {
+       # Yes, the indenting on these is weird, but it has to be like
+       # this otherwise it won't display properly.
+
+       PS1="\n${TITLEBAR}\[${D_USER_COLOR}\]\u ${white}\
+at \[${D_MACHINE_COLOR}\]\h ${white}\
+in \[${D_DIR_COLOR}\]\w ${white}\
+$(mitsuhikos_lastcommandfailed)\
+$(demula_vcprompt)\
+$(is_vim_shell)
+$ ${normal}"
+}
+
+PS2="$ "
+
+PROMPT_COMMAND=prompt