From 919fba0429b5642a8af14d306ce5dcd28fec953a Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Wed, 19 Jan 2022 08:18:14 -0800 Subject: [PATCH] Simplify PWD --- functions/_tide_pwd.fish | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/functions/_tide_pwd.fish b/functions/_tide_pwd.fish index f45b01b..6eff0cb 100644 --- a/functions/_tide_pwd.fish +++ b/functions/_tide_pwd.fish @@ -7,14 +7,10 @@ set -l home_icon $tide_pwd_icon_home'\ ' set -l pwd_icon $tide_pwd_icon'\ ' eval "function _tide_pwd - set -l split_pwd (string replace -r -- ^$HOME '~' \$PWD | string split /) - - if not test -w \$PWD - set -f icon $unwritable_icon - else if test \$PWD = $HOME - set -f icon $home_icon + if set -l split_pwd (string replace -r -- ^$HOME '~' \$PWD | string split /) + test -w \$PWD && set -f icon $pwd_icon || set -f icon $unwritable_icon else - set -f icon $pwd_icon + set -f icon $home_icon end # Anchor first and last directories (which may be the same)