Commit a7f5170d authored by Marc Cornellà's avatar Marc Cornellà
Browse files

Remove perl dependency

parent 0dc83fe4
zmodload zsh/datetime
__timer_current_time() { __timer_current_time() {
perl -MTime::HiRes=time -e'print time' zmodload zsh/datetime
echo $EPOCHREALTIME
} }
__timer_format_duration() { __timer_format_duration() {
......
# 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 ' local -a pwd=("${(s:/:)PWD/#$HOME/~}")
BEGIN { for i in {1..$(($#pwd-1))}; do
binmode STDIN, ":encoding(UTF-8)"; if [[ "$pwd[$i]" = .* ]]; then
binmode STDOUT, ":encoding(UTF-8)"; pwd[$i]="${${pwd[$i]}[1,2]}"
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g else
') pwd[$i]="${${pwd[$i]}[1]}"
fi
done
echo "${(j:/:)pwd}"
} }
local user_color='green'; [ $UID -eq 0 ] && user_color='red' local user_color='green'; [ $UID -eq 0 ] && user_color='red'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# This theme needs a terminal supporting 256 colors as well as unicode. # This theme needs a terminal supporting 256 colors as well as unicode.
# In order to avoid external dependencies, it also has a zsh version of # In order to avoid external dependencies, it also has a zsh version of
# the perl script at https://github.com/trapd00r/utils/blob/master/zsh_path, # the previously used perl script https://github.com/trapd00r/utils/blob/master/zsh_path,
# which splits up the current path and makes it fancy. # which splits up the current path and makes it fancy.
# #
# By default it spans over two lines like so: # By default it spans over two lines like so:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment