i did a little bash thing that allows you to get the Template functionality most file explorers have within your terminal.
templ(){
FILE=$1
EXTENSION=${1#${1%\.}}
TEMPLATE=$(find ~/Templates -maxdepth 1 -type f -iname "$EXTENSION")
if [ -f "$FILE" ]; then
echo "File $FILE exists."
return 1;
fi
if [ ! -f "$TEMPLATE" ]; then
echo "No Template Found; creating blank file"
touch $FILE
return 1;
fi
cp "$TEMPLATE" "$FILE"
}
it's supposted to kinda work like an extended touch where it detects the extension and if it finds a template in ~/Templates then it just copies that over.
i wanted it because i found myself googling "[language] boilerplate" a lot recently
just copy it over to your .bashrc or source it from a seperate file, populate your Templates directory with some templates and you should be good to go.
if you have any additional ideas then please tell. i'm thinking of maybe having a couple different templates for the same extension, like java interface vs class that you have to choose but idk.
also i didn't really check to see if that kind of thing already existed, so if it does please tell me












