summaryrefslogtreecommitdiff
path: root/etc/prompt
blob: cbbb25a27ee8f743cf4255edbdba2e02bc4ab9e7 (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{reset}"
	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