diff options
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-x | dotfiles/.local/bin/ftv | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/ftv b/dotfiles/.local/bin/ftv new file mode 100755 index 0000000..4b79083 --- /dev/null +++ b/dotfiles/.local/bin/ftv @@ -0,0 +1,21 @@ +#!/bin/sh + +# Script to start a new textfile from template + +templdir=$HOME"/docs/templates/" + +if [ -z "$2" ]; then + echo "Specify template filename and new filename" + exit 0 +fi + +template="$templdir$1" +file=$(readlink -f "$2") + +if [ ! -f "$template" ]; then + echo "Template $1 does not exist" + exit 0 +fi + +cp $template $file +nvim $file |