summaryrefslogtreecommitdiff
path: root/functions/utilities.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'functions/utilities.zsh')
-rwxr-xr-xfunctions/utilities.zsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index 3a77eaca..0d04413e 100755
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -30,6 +30,18 @@ function set_default() {
fi
}
+function _p9k_g_expand() {
+ local -a ts=("${=$(typeset -p $1)}")
+ shift ts
+ for x in "${ts[@]}"; do
+ [[ $x == -* ]] || break
+ # Don't change readonly variables. Ideally, we shouldn't modify any variables at all,
+ # but for now this will do.
+ [[ $x == -*r* ]] && return
+ done
+ typeset -g $1=${(g::)${(P)1}}
+}
+
# Converts large memory values into a human-readable unit (e.g., bytes --> GB)
# Takes two arguments:
# * $size - The number which should be prettified