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:
parent
2562a50f89
commit
66e0bf911b
@ -1,12 +1,7 @@
|
||||
# ZSH Theme emulating the Fish shell's default prompt.
|
||||
|
||||
_fishy_collapsed_wd() {
|
||||
echo $(pwd | perl -pe '
|
||||
BEGIN {
|
||||
binmode STDIN, ":encoding(UTF-8)";
|
||||
binmode STDOUT, ":encoding(UTF-8)";
|
||||
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
|
||||
')
|
||||
pwd | sed -E 's|^'$HOME'|~|;s|(.*)/|\1%|;s|((^\|/)\.?[^/%]{1})[^/%]*|\1|g;s|(.*)%|\1/|'
|
||||
}
|
||||
|
||||
git_prompt_info() {
|
||||
|
Loading…
Reference in New Issue
Block a user