1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00
dotfiles/zsh/plugins/fish-theme.zsh
Joe Groocock 60bf423556
dotfiles: move .config/* to root
This seems to make more sense. Almost all files were within .config
anyway.

Signed-off-by: Joe Groocock <me@frebib.net>
2020-08-10 22:42:14 +01:00

15 lines
404 B
Bash

# ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() {
pwd | sed -E 's|^'$HOME'|~|;s|(.*)/|\1%|;s|((^\|/)\.?[^/%]{1})[^/%]*|\1|g;s|(.*)%|\1/|'
}
# Required for dynamic prompt
setopt prompt_subst
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
PROMPT="%n@%m %F{$user_color}\$(_fishy_collapsed_wd)%f%(!.#.>) "
PROMPT2='%F{red}\ %f'
RPROMPT='%F{red}%(?.. %?)%f'