From 7ff27ca5bcec0f2dd23c2bb9e303ee3c0dfc5ae7 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Thu, 5 Jul 2018 11:54:18 +0200 Subject: [PATCH] Add new custom plugin: helpers functions. --- .../plugins/my_helpers/my_helpers.plugin.zsh | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 zsh/custom/plugins/my_helpers/my_helpers.plugin.zsh diff --git a/zsh/custom/plugins/my_helpers/my_helpers.plugin.zsh b/zsh/custom/plugins/my_helpers/my_helpers.plugin.zsh new file mode 100644 index 0000000..f07025f --- /dev/null +++ b/zsh/custom/plugins/my_helpers/my_helpers.plugin.zsh @@ -0,0 +1,27 @@ +# +# Functions +# +function copy_archive { + ext=".ori" + + ori_name="$1" + new_name=${ori_name}.${ext} + + cp -a ${ori_nam} ${new_name} +} + +function convert_asy_to_png { + asy "$1" + + filename=$(basename -s .asy "$1") + + rsvg-convert "$filename.svg" -o $(echo "$filename.svg" | sed -e 's/svg$/png/') +} + + + +# +# Aliases +# +alias cpa="copy_archive $1" +alias asy2png="convert_asy_to_png $1"