From a48288ad5067dd60a3e7b866b13ebd1aede3d58c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 25 Nov 2021 11:00:40 +0000 Subject: [PATCH] zsh: Simplify fish-like compressed working directory Works the same, is simpler and less prone to doing the wrong thing, hopefully... Signed-off-by: Joe Groocock --- zsh/plugins/fish-theme.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/plugins/fish-theme.zsh b/zsh/plugins/fish-theme.zsh index 0e177c7..68fcd71 100644 --- a/zsh/plugins/fish-theme.zsh +++ b/zsh/plugins/fish-theme.zsh @@ -1,7 +1,7 @@ # 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/|' + pwd | sed -E 's|^'$HOME'|~|;s|([\.~]?[^/]{1})[^/]*/|\1/|g' } function zle-line-init zle-keymap-select {