-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hey, I saw that template addition was not available so I wrote something that will produce the above mentioned result:
function AddTemplate(tmpl_file)
exe "0read " . a:tmpl_file
let substDict = {}
let substDict["date"] = strftime("%Y %b %d %X")
exe '%s/<<\([^>]*\)>>/\=substDict[submatch(1)]/g'
set nomodified
normal G
endfunction
autocmd BufNewFile todo.md call AddTemplate("~/.vim/plugged/vim-bujo/templates/md.skeleton")
The change I think needed is to have it automatically find the template file.
Also my template file (Minor Changes from yours),
_____ _ __ _ __ _ __
/_ __/ __ \/ __ \/ __ \
/ / / / / / / / / / / /
/ / / /_/ / /_/ / /_/ /
/_/ \_ _/_ _ /\_ _/
Date: <<date>>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
