]> git.alrj.org Git - zsh.d.git/blob - S90_prompt
Use emacs bindings
[zsh.d.git] / S90_prompt
1 #! /usr/bin/zsh
2
3 autoload -U colors
4 colors
5 setopt prompt_subst
6
7 #
8 # Prepare colors, ignoring length
9 #
10 C_NO="%{$reset_color%}"
11 C_BYELLOW="%{${fg_bold[yellow]}%}"
12 C_BRED="%{${fg_bold[red]}%}"
13 C_BCYAN="%{${fg_bold[cyan]}%}"
14 C_GREEN="%{${fg[green]}%}"
15 C_MAGENTA="%{${fg_bold[magenta]}%}"
16
17
18
19 #
20 # Prompt parts
21 #
22 _username="${C_BYELLOW}%n${C_NO}"
23 _machine="${C_BRED}%m${C_NO}"
24 _hour="${C_BCYAN}[%D{%H:%M}]${C_NO}"
25
26 _exitcode="%(?::${C_BRED}[ %1v ]${C_NO}
27 )$(true)"
28
29 _action="%(3v,%3v%,)"
30 _path='${C_GREEN}%(5v,%20<..<%5v%<<${C_NO}${C_MAGENTA}@%4v%3v${C_NO}${C_GREEN}/%15<..<%6v%<<,%25<..<%~%<<)${C_NO}'
31
32
33 #
34 # Now, the prompt itself
35 #
36 #PROMPT="${_exitcode}${_hour} ${_username}@${_machine}:${_vcs}${_path}$ "
37 PROMPT="${_exitcode}${_username}@${_machine}:${_vcs}${_path}$ "
38