1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

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 <me@frebib.net>
This commit is contained in:
Joe Groocock 2021-11-25 11:00:40 +00:00
parent b519b48e83
commit a48288ad50
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -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 {