blob: afc636530a280716bee15add88b2305d1d4a180b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
## Prompt
## vim:ft=zsh
# RPS1 is on the right side of the terminal
# The \ek\e\\ is for screen's 'shelltitle'
# psvar[1] = directory info
# psvar[2] = rtab (current directory)
typeset -A ps rps
ps=(
host "%F{yellow}%m"
dir "%F{default}%30<…<%2v%>>"
sign "%(!.%F{red}.%F{green})%(?.%(!.#.>).%?)%F{default}"
screen $'%{\ek\e\\%}'
)
rps=(
start_always "%F{yellow}["
start_screen "%(1V.%F{yellow}["
dirinfo "%F{default}%1v"
time '%T'
end_always "%F{yellow}]%F{default}"
end_screen "%(1V.%F{yellow}]%F{default}.)"
)
PS1="${ps[host]} ${ps[dir]} ${ps[sign]} ${ps[screen]}"
if [[ $TERM == screen ]] {
RPS1="${rps[start_screen]}${rps[dirinfo]}${rps[end_screen]}"
} else {
RPS1="${rps[start_always]}${rps[dirinfo]}${rps[time]}${rps[end_always]}"
}
unset ps rps
zstyle ':prompt:rtab' fish yes
zstyle ':prompt:rtab' nameddirs yes
|