lutherus

Untitled

Apr 28th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. # set formats
  2. # %s - VCS in use
  3. # %r - repo name
  4. # %b - branchname
  5. # %u - unstagedstr (see below)
  6. # %c - stangedstr (see below)
  7. # %a - action (e.g. rebase-i)
  8. # %R - repository path
  9. # %S - path in the repository
  10. FMT_BRANCH="${PR_YELLOW}%s > ${PR_GREEN}%r > ${PR_CYAN}%b%u%c > "
  11. # e.g. master¹²
  12. FMT_ACTION="(${PR_YELLOW}%a${PR_NO_COLOR}%)" # e.g. (rebase-i)
  13. FMT_PATH="${PR_BLACK}%R${PR_YELLOW}/%S" # e.g. ~/repo/subdir
  14.  
  15. # check-for-changes can be really slow.
  16. # you should disable it, if you work with large repositories
  17. zstyle ':vcs_info:*' check-for-changes true
  18. zstyle ':vcs_info:*' unstagedstr '¹' # display ¹ if there are unstaged changes
  19. zstyle ':vcs_info:*' stagedstr '²' # display ² if there are staged changes
  20. zstyle ':vcs_info:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" "${FMT_PATH}"
  21. zstyle ':vcs_info:*' formats "${FMT_BRANCH}" "${FMT_PATH}"
  22. zstyle ':vcs_info:*' nvcsformats "" "%~"
  23.  
  24. prompt() {
  25. if [[ "${vcs_info_msg_0_}" == "" ]]; then
  26.  
  27. PROMPT=' ${PR_CYAN}%~${PR_NO_COLOR} ${PR_RED}>${PR_NO_COLOR} '
  28. RPROMPT=''
  29.  
  30. else
  31.  
  32. PROMPT=' ${vcs_info_msg_0_}${PR_LIGHT_CYAN}%B%1~%b ${PR_YELLOW}>${PR_NO_COLOR} '
  33. RPROMPT='${${vcs_info_msg_1_%%.}/$HOME/~}${PR_NO_COLOR}'
  34.  
  35. fi
  36. }
Advertisement
Add Comment
Please, Sign In to add comment