From d0c20b567884bf5beb2f393ffe24e4414816298e Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 6 Nov 2012 11:42:40 -0500 Subject: [PATCH 1/2] kylewest theme --- zsh/prezto-themes/prompt_kylewest_setup | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 zsh/prezto-themes/prompt_kylewest_setup diff --git a/zsh/prezto-themes/prompt_kylewest_setup b/zsh/prezto-themes/prompt_kylewest_setup new file mode 100644 index 00000000..b924ff8c --- /dev/null +++ b/zsh/prezto-themes/prompt_kylewest_setup @@ -0,0 +1,56 @@ +# +# A theme based on sorin theme +# * ruby info shown on the right +# * git info on the left +# * editor mode as $> or <# +# * single line prompt +# +# Authors: +# Sorin Ionescu +# Kyle West + +function prompt_kylewest_precmd { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + + # Get Git repository information. + if (( $+functions[git-info] )); then + git-info + fi + + # Get ruby information + if (( $+functions[ruby-info] )); then + ruby-info + fi +} + +function prompt_kylewest_setup { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + prompt_opts=(cr percent subst) + + # Load required functions. + autoload -Uz add-zsh-hook + + # Add hook for calling git-info before each command. + add-zsh-hook precmd prompt_kylewest_precmd + + # editor + zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' + zstyle ':prezto:module:editor:info:keymap:primary' format "%B%F{green}$>%f%b" + zstyle ':prezto:module:editor:info:keymap:alternate' format "%B%F{magenta}<#%f%b" + + # ruby info (rvm, rbenv) + zstyle ':prezto:module:ruby:info:version' format '[ %v ]' + + # vcs + zstyle ':prezto:module:git:info:branch' format '%F{yellow}%b%f' + zstyle ':prezto:module:git:info:dirty' format '%B%F{red}!%f%b' + zstyle ':prezto:module:git:info:keys' format 'prompt' '- %b%D ' + + # prompts + PROMPT='%F{cyan}%c%f ${git_info[prompt]}${editor_info[keymap]} ' + RPROMPT="%F{blue}"'${ruby_info[version]}' +} + +prompt_kylewest_setup "$@" From d40f1bedbe34522e0c3c9f7b79a8b40c1ff9a1e6 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 6 Nov 2012 11:50:56 -0500 Subject: [PATCH 2/2] cleanup RPROMPT --- zsh/prezto-themes/prompt_kylewest_setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/prezto-themes/prompt_kylewest_setup b/zsh/prezto-themes/prompt_kylewest_setup index b924ff8c..4d397d14 100644 --- a/zsh/prezto-themes/prompt_kylewest_setup +++ b/zsh/prezto-themes/prompt_kylewest_setup @@ -50,7 +50,7 @@ function prompt_kylewest_setup { # prompts PROMPT='%F{cyan}%c%f ${git_info[prompt]}${editor_info[keymap]} ' - RPROMPT="%F{blue}"'${ruby_info[version]}' + RPROMPT='%F{blue}${ruby_info[version]}' } prompt_kylewest_setup "$@"