From 6034ee7222dae1e652595620b264ac16abd7d11f Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Thu, 22 Dec 2022 20:56:48 +0200 Subject: [PATCH] Borrow a pretty dotfiles status function --- .zshrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.zshrc b/.zshrc index 9ccf048..7931831 100644 --- a/.zshrc +++ b/.zshrc @@ -30,6 +30,17 @@ function _config_deactivate { unset GIT_DIR GIT_WORK_TREE CONFIG_ENV } +function config_status { + # Borrowed from https://mitxela.com/projects/dotfiles_management + ( + _config_activate + for i in $(git ls-files); do + echo -n "$(git -c color.status=always status $i -s | sed "s#$i##")" + echo -e "¬/$i¬\e[0;33m$(git -c color.ui=always log -1 --format="%s" -- $i)\e[0m" + done + ) | column -t --separator=¬ -T2 +} + function config { if [[ -n "$1" ]]; then _config_activate