Advertisement
Manuzor

af-magic-custom

Dec 5th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.57 KB | None | 0 0
  1. # af-magic.zsh-theme
  2. #
  3. # Author: Andy Fleming
  4. # URL: http://andyfleming.com/
  5. # Repo: https://github.com/andyfleming/oh-my-zsh
  6. # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
  7. #
  8. # Created on:       June 19, 2012
  9. # Last modified on: June 20, 2012
  10.  
  11.  
  12.  
  13. if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
  14. local return_code="%(?..%{$fg[red]%}%? โ†ต%{$reset_color%})"
  15.  
  16. function _make-prompt()
  17. {
  18.     local theUser='%{$fg_bold[blue]%}%n%{$reset_color%}'
  19.     local theMachine='%{$fg_no_bold[cyan]%}%m%{$reset_color%}'
  20.     local theDir='%{$fg_bold[blue]%}%~%{$reset_color%}'
  21.     local gitInfo='$(git_prompt_info)'
  22.     local theTime='[%{$fg_no_bold[cyan]%}%*%{$reset_color%}]'
  23.     local promptChar='%{$fg_bold[blue]%}%(!.#.ยป)%{$reset_color%}'
  24.  
  25.     echo "${theUser}@${theMachine}:${theDir} ${gitInfo}"
  26.     echo "${theTime} ${promptChar} "
  27. }
  28.  
  29. function _make-rprompt()
  30. {
  31.     echo "%?"
  32. }
  33.  
  34. # primary prompt
  35. PROMPT="$(_make-prompt)"
  36.  
  37. # right prompt
  38. RPROMPT="$(_make-rprompt)"
  39.  
  40. #PROMPT2='[%F{gray}%*%f]'
  41. RPS1='${return_code}'
  42.  
  43. # git settings
  44. ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[yellow]%}"
  45. ZSH_THEME_GIT_PROMPT_CLEAN=""
  46. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*"
  47. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
  48.  
  49.  
  50. # custom functions
  51.  
  52. git_prompt_info () {
  53.     ref=$(command git symbolic-ref HEAD 2> /dev/null)  || ref=$(command git rev-parse --short HEAD 2> /dev/null)  || return
  54.     echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"                                                              
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement