From 2eaee515347a611e4324a616bcba0e6294e6f4fa Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 2 Jul 2020 16:31:38 +0200 Subject: [PATCH] move common functions at the top --- dot_zsh_functions | 68 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index 029735f..0697ece 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -1,3 +1,37 @@ +# Text formatting utilities +bold=$(tput bold) +underline=$(tput sgr 0 1) +reset=$(tput sgr0) +purple=$(tput setaf 171) +red=$(tput setaf 1) +green=$(tput setaf 76) +tan=$(tput setaf 3) +blue=$(tput setaf 38) +header() { + printf "\n${bold}${purple}========== %s ==========${reset}\n" "$@" +} +arrow() { + printf " ➜ $@\n" +} +success() { + printf "${green} ✔ %s${reset}\n" "$@" +} +error() { + printf "${red} ✖ %s${reset}\n" "$@" +} +warning() { + printf "${tan} ➜ %s${reset}\n" "$@" +} +underline() { + printf "${underline}${bold}%s${reset}\n" "$@" +} +bold() { + printf "${bold}%s${reset}\n" "$@" +} +note() { + printf "${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" +} +# Browser interaction utilities function google() { open -na "Google Chrome" --args "https://www.google.com/search?q=$*" } @@ -171,7 +205,7 @@ function how_in() { function rate() { curl "http://rate.sx/$*" } -transfer() { +function transfer() { # check arguments if [ $# -eq 0 ]; then @@ -266,39 +300,7 @@ function terragrunt_color { -e "s/\( *.*: *\".*\"\)/${GREEN}\1${RESET}/" } -bold=$(tput bold) -underline=$(tput sgr 0 1) -reset=$(tput sgr0) -purple=$(tput setaf 171) -red=$(tput setaf 1) -green=$(tput setaf 76) -tan=$(tput setaf 3) -blue=$(tput setaf 38) -header() { - printf "\n${bold}${purple}========== %s ==========${reset}\n" "$@" -} -arrow() { - printf " ➜ $@\n" -} -success() { - printf "${green} ✔ %s${reset}\n" "$@" -} -error() { - printf "${red} ✖ %s${reset}\n" "$@" -} -warning() { - printf "${tan} ➜ %s${reset}\n" "$@" -} -underline() { - printf "${underline}${bold}%s${reset}\n" "$@" -} -bold() { - printf "${bold}%s${reset}\n" "$@" -} -note() { - printf "${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" -} function git-project { if [ -d "$REPO_PATH" ]; then