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

zsh: replace perl pwd with POSIX sed variant

This commit is contained in:
Joe Groocock 2018-07-30 09:29:00 +01:00
parent 2562a50f89
commit 66e0bf911b
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -1,12 +1,7 @@
# ZSH Theme emulating the Fish shell's default prompt. # ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() { _fishy_collapsed_wd() {
echo $(pwd | perl -pe ' pwd | sed -E 's|^'$HOME'|~|;s|(.*)/|\1%|;s|((^\|/)\.?[^/%]{1})[^/%]*|\1|g;s|(.*)%|\1/|'
BEGIN {
binmode STDIN, ":encoding(UTF-8)";
binmode STDOUT, ":encoding(UTF-8)";
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
')
} }
git_prompt_info() { git_prompt_info() {