summaryrefslogtreecommitdiff
path: root/etc/prompt
blob: 46f4b9422e074ba3794d03a092ee8be873b5f715 (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   "${ps_yellow}%m"
	dir    "${ps_reset}%30<…<%2v%>>"
	sign   "%(!.${ps_red}.${ps_green})%(?.%(!.#.>).%?)${ps_reset}"
	screen $'%{\ek\e\\%}'
)

rps=(
	start_always "${ps_yellow}["
	start_screen "%(1V.${ps_yellow}["
	dirinfo      "${ps_info}%1v${ps_reset}"
	time         '%T'
	end_always   "${ps_yellow}]${ps_reset}"
	end_screen   "%(1V.${ps_yellow}]${ps_reset}.)"
)

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