aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.prompts/prompt_skwp_setup
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-10-31 18:30:03 +0100
committerDavid Runge <david.runge@frqrec.com>2014-10-31 18:30:03 +0100
commitccf94b7df09799feb201d1a59928932fda4e24f4 (patch)
tree32a8352121f29c02ac3e3024deaae338c5fc04a3 /.zsh.prompts/prompt_skwp_setup
parentca44a29e2ebd7c2fc80899139335ee1547867ea6 (diff)
downloaddotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.gz
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.bz2
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.xz
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.zip
zsh: Adding config files for zprezto, zsh settings and prompts, to comply with the way zprezto gets started
Diffstat (limited to '.zsh.prompts/prompt_skwp_setup')
-rw-r--r--.zsh.prompts/prompt_skwp_setup74
1 files changed, 74 insertions, 0 deletions
diff --git a/.zsh.prompts/prompt_skwp_setup b/.zsh.prompts/prompt_skwp_setup
new file mode 100644
index 0000000..c45eb8a
--- /dev/null
+++ b/.zsh.prompts/prompt_skwp_setup
@@ -0,0 +1,74 @@
+#
+# A theme based on steeef theme
+# * RVM/Rbenv info shown on the right
+# * Git branch info on the left
+# * Single line prompt
+#
+# Authors:
+# Steve Losh <steve@stevelosh.com>
+# Bart Trojanowski <bart@jukie.net>
+# Brian Carper <brian@carper.ca>
+# steeef <steeef@gmail.com>
+# Sorin Ionescu <sorin.ionescu@gmail.com>
+# Yan Pritzker <yan@pritzker.ws>
+
+function prompt_skwp_precmd {
+ setopt LOCAL_OPTIONS
+ unsetopt XTRACE KSH_ARRAYS
+
+ # Get Git repository information.
+ if (( $+functions[git-info] )); then
+ git-info on
+ git-info
+ fi
+
+ # Get ruby information
+ if (( $+functions[ruby-info] )); then
+ ruby-info
+ fi
+}
+
+function prompt_skwp_setup {
+ setopt LOCAL_OPTIONS
+ unsetopt XTRACE KSH_ARRAYS
+ prompt_opts=(cr percent subst)
+
+ autoload -Uz add-zsh-hook
+
+ add-zsh-hook precmd prompt_skwp_precmd
+
+ # Use extended color pallete if available.
+ if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
+ __PROMPT_SKWP_COLORS=(
+ "%F{81}" # turquoise
+ "%F{166}" # orange
+ "%F{135}" # purple
+ "%F{161}" # hotpink
+ "%F{118}" # limegreen
+ )
+ else
+ __PROMPT_SKWP_COLORS=(
+ "%F{cyan}"
+ "%F{yellow}"
+ "%F{magenta}"
+ "%F{red}"
+ "%F{green}"
+ )
+ fi
+
+ # git
+ zstyle ':prezto:module:git:info:branch' format "${__PROMPT_SKWP_COLORS[1]}%b%f"
+ zstyle ':prezto:module:git:info:added' format "${__PROMPT_SKWP_COLORS[5]}●%f"
+ zstyle ':prezto:module:git:info:deleted' format "${__PROMPT_SKWP_COLORS[2]}●%f"
+ zstyle ':prezto:module:git:info:modified' format "${__PROMPT_SKWP_COLORS[4]}●%f"
+ zstyle ':prezto:module:git:info:untracked' format "${__PROMPT_SKWP_COLORS[3]}●%f"
+ zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%d%a%m%u)'
+
+ # ruby info (rvm, rbenv)
+ zstyle ':prezto:module:ruby:info:version' format '[%v]'
+
+ PROMPT="${__PROMPT_SKWP_COLORS[3]}%n%f@${__PROMPT_SKWP_COLORS[2]}%m%f ${__PROMPT_SKWP_COLORS[5]}%~%f "'$git_info[prompt]'"$ "
+ RPROMPT='%F{blue}${ruby_info[version]}'
+}
+
+prompt_skwp_setup "$@"