Skip to content

Commit

Permalink
add zt
Browse files Browse the repository at this point in the history
  • Loading branch information
locphan87 committed Sep 12, 2020
0 parents commit 9fb8209
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions zt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
echo "Creating a new Zettel"

DATE_FORMAT="%Y%m%d.%H%M%S"

read -p "Enter your title: " title
newTitle=$(echo $title | tr " " "-" | tr '[:upper:]' '[:lower:]')

read -p "Enter your tags: " tags

# Making the file name
FILE_NAME=$(date +$DATE_FORMAT).$newTitle.md
# Add title and tags to the file
echo "# $title\n$tags\n" > $FILE_NAME

# Open the file and move to the end of file
vim "+normal Go" $FILE_NAME

0 comments on commit 9fb8209

Please sign in to comment.