From 355787c3ee8a666986bb665ba6a91726c5916164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Suarez=20Ordo=C3=B1ez?= Date: Sat, 4 May 2013 17:19:44 -0700 Subject: [PATCH] santiycr's theme --- .../prompt/functions/prompt_santiycr_setup | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 modules/prompt/functions/prompt_santiycr_setup diff --git a/modules/prompt/functions/prompt_santiycr_setup b/modules/prompt/functions/prompt_santiycr_setup new file mode 100644 index 00000000..1925155b --- /dev/null +++ b/modules/prompt/functions/prompt_santiycr_setup @@ -0,0 +1,56 @@ +# +# A clean but informative theme based on Sorin Ionescu's +# +# Authors: +# Santiago Suarez Ordoñez +# + +# Load dependencies. +pmodload 'helper' + +function prompt_santiycr_precmd { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + + # Get Git repository information. + if (( $+functions[git-info] )); then + git-info + fi +} + +function prompt_santiycr_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_santiycr_precmd + + zstyle ':prezto:module:editor:info:completing' format '%F{red}...%f' + zstyle ':prezto:module:editor:info:keymap:primary' format '%F{red}❯%F{yellow}❯%F{green}❯%f' + zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format '%F{red}♺%f' + zstyle ':prezto:module:editor:info:keymap:alternate' format '%F{green}❮%F{yellow}❮%F{red}❮%f' + zstyle ':prezto:module:git:info:action' format ':%F{yellow}%s%f' + zstyle ':prezto:module:git:info:branch' format ':%F{green}%b%f' + zstyle ':prezto:module:git:info:commit' format ':%F{green}%.7c%f' + zstyle ':prezto:module:git:info:position' format ':%F{red}%p%f' + zstyle ':prezto:module:git:info:dirty' format '%F{red}✗%f' + zstyle ':prezto:module:git:info:clean' format '%F{green}✔%f' + zstyle ':prezto:module:git:info:keys' format \ + 'prompt' '%F{blue}git%f$(coalesce "%b" "%p" "%c")%s' \ + 'rprompt' '%C%D' + + if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then + HOS=" %F{magenta}☁ %f (%F{yellow}%m%f)" + else + HOS="" + fi + PROMPT='%F{cyan}%n%f %2~$HOS ${git_info:+${(e)git_info[prompt]}} ${editor_info[keymap]} ' + RPROMPT='${git_info[rprompt]}%f ${VIM:+" %F{green}V%f"} %F{blue}[%*]%f' + SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' +} + +prompt_santiycr_setup "$@"