Advertisement
Guest User

Untitled

a guest
Jun 20th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #
  2. # A theme based on steeef theme
  3. # * RVM/Rbenv info shown on the right
  4. # * Git branch info on the left
  5. # * Single line prompt
  6. #
  7. # Authors:
  8. # Steve Losh <steve@stevelosh.com>
  9. # Bart Trojanowski <bart@jukie.net>
  10. # Brian Carper <brian@carper.ca>
  11. # steeef <steeef@gmail.com>
  12. # Sorin Ionescu <sorin.ionescu@gmail.com>
  13. # Yan Pritzker <yan@pritzker.ws>
  14.  
  15. function prompt_skwp_precmd {
  16. setopt LOCAL_OPTIONS
  17. unsetopt XTRACE KSH_ARRAYS
  18.  
  19. # Get Git repository information.
  20. if (( $+functions[git-info] )); then
  21. git-info on
  22. git-info
  23. fi
  24.  
  25. # Get ruby information
  26. if (( $+functions[ruby-info] )); then
  27. ruby-info
  28. fi
  29.  
  30. if [ -d ".elasticbeanstalk" ] ;
  31. then
  32. EB_STATUS="%F{green}[$(eb status | head -1 | cut -d':' -f 2 | cut -d' ' -f 2)]"
  33. else
  34. EB_STATUS=""
  35. fi
  36. }
  37.  
  38. function prompt_skwp_setup {
  39. setopt LOCAL_OPTIONS
  40. unsetopt XTRACE KSH_ARRAYS
  41. prompt_opts=(cr percent subst)
  42.  
  43. autoload -Uz add-zsh-hook
  44.  
  45. add-zsh-hook precmd prompt_skwp_precmd
  46.  
  47. # Use extended color pallete if available.
  48. if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
  49. __PROMPT_SKWP_COLORS=(
  50. "%F{81}" # turquoise
  51. "%F{166}" # orange
  52. "%F{135}" # purple
  53. "%F{161}" # hotpink
  54. "%F{118}" # limegreen
  55. )
  56. else
  57. __PROMPT_SKWP_COLORS=(
  58. "%F{cyan}"
  59. "%F{yellow}"
  60. "%F{magenta}"
  61. "%F{red}"
  62. "%F{green}"
  63. )
  64. fi
  65.  
  66. # git
  67. zstyle ':prezto:module:git:info:branch' format "${__PROMPT_SKWP_COLORS[1]}%b%f"
  68. zstyle ':prezto:module:git:info:added' format "${__PROMPT_SKWP_COLORS[5]}●%f"
  69. zstyle ':prezto:module:git:info:deleted' format "${__PROMPT_SKWP_COLORS[2]}●%f"
  70. zstyle ':prezto:module:git:info:modified' format "${__PROMPT_SKWP_COLORS[4]}●%f"
  71. zstyle ':prezto:module:git:info:untracked' format "${__PROMPT_SKWP_COLORS[3]}●%f"
  72. zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%d%a%m%u)'
  73.  
  74. # ruby info (rvm, rbenv)
  75. zstyle ':prezto:module:ruby:info:version' format '[%v]'
  76.  
  77. PROMPT="${__PROMPT_SKWP_COLORS[3]}%n%f@${__PROMPT_SKWP_COLORS[2]}%m%f ${__PROMPT_SKWP_COLORS[5]}%~%f "'$git_info[prompt]'"$ "
  78. RPROMPT='$EB_STATUS%F{blue}${ruby_info[version]}'
  79. }
  80.  
  81. prompt_skwp_setup "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement