Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. #
  2. # A colorful, friendly, multiline theme with some handy features.
  3. # Based on the 'giddie' theme by Paul Gideon Dann.
  4. #
  5. # Authors:
  6. # Michael Kohl <citizen428@gmail.com>
  7. # Paul Gideon Dann <pd@gmail.com>
  8. # Sorin Ionescu <sorin.ionescu@gmail.com>
  9. #
  10. # Features:
  11. # - Simple VCS branch, staged, and unstaged indication.
  12. # - Last command exit status is displayed in RPROMPT when non-zero.
  13. #
  14. # Screenshots:
  15. #
  16. #
  17.  
  18. function +vi-git_precmd {
  19. # Check for untracked files, since vcs_info does not.
  20. if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
  21. hook_com[unstaged]+='%F{red}●%f'
  22. fi
  23. }
  24.  
  25. function prompt_citizen428_precmd {
  26. # Replace '/home/<user>' with '~'.
  27. _prompt_citizen428_pwd="${PWD/#$HOME/~}"
  28. ruby-info
  29. vcs_info
  30. }
  31.  
  32. function prompt_citizen428_setup {
  33. setopt LOCAL_OPTIONS
  34. unsetopt XTRACE KSH_ARRAYS
  35. prompt_opts=(cr percent subst)
  36.  
  37. # Load required functions.
  38. autoload -Uz vcs_info
  39. autoload -Uz add-zsh-hook
  40.  
  41. # Add hook to set up prompt parameters before each command.
  42. add-zsh-hook precmd prompt_citizen428_precmd
  43.  
  44. # Set vcs_info parameters.
  45. zstyle ':vcs_info:*' check-for-changes true
  46. zstyle ':vcs_info:*' formats '[%b%c%u]'
  47. zstyle ':vcs_info:*' actionformats '[%b%c%u %F{magenta}(%a)%f]'
  48. zstyle ':vcs_info:*' stagedstr '%F{green}●%f'
  49. zstyle ':vcs_info:*' unstagedstr '%F{yellow}●%f'
  50.  
  51. # Set vcs_info hooks.
  52. # NOTE: Prior to Zsh v4.3.12, there are no static hooks, no vcs_info_hookadd
  53. # function, and no 'no-vcs' hook.
  54. zstyle ':vcs_info:git*+set-message:*' git_precmd
  55.  
  56. # Set ruby-info parameters
  57. zstyle ':prezto:module:ruby:info:version' format '%v'
  58.  
  59. # Define prompts.
  60. PROMPT='%(?..%F{red}%B[✘] %b%f)%F{green}%n@%m%f %F{blue}[${_prompt_citizen428_pwd}]%f %F{red}[$ruby_info[version]]%f %F{yellow}${vcs_info_msg_0_}%f
  61. %F{white}→%f '
  62. SPROMPT='zsh: correct %F{magenta}%R%f to %F{green}%r%f [nyae]? '
  63. }
  64.  
  65. prompt_citizen428_setup "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement