diff --git a/files/fish/functions/prompt.fish b/files/fish/functions/prompt.fish index 93a37b9..0bb7dea 100644 --- a/files/fish/functions/prompt.fish +++ b/files/fish/functions/prompt.fish @@ -24,9 +24,15 @@ function fish_cwd_prompt case "/" printf "/" case "*" - set -l parent_dir (basename (dirname $cwd)) - test $parent_dir = "/" || printf "%s" $parent_dir - printf '/%s' (basename $cwd) + set -l parent_dir (dirname $cwd) + switch "$parent_dir" + case "$HOME" + printf "~/%s" (basename $cwd) + case "/" + printf "/%s" (basename $cwd) + case "*" + printf "%s/%s" (basename $parent_dir) (basename $cwd) + end end end