summaryrefslogtreecommitdiff
path: root/etc/prompt
blob: 91efe0b2c6bcd57f1e4a2efed69802f1c91dd98d (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{cyan}%1v%F{default}"
	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