I've got a template for vimwiki diary entries that's invoked via this autocommand:
autocmd BufNewFile ~/Documents/wiki/diary/*.mkd :silent 0r !vimwiki-diary-template.py
But I want to be able to create other *mkd
files in that directory without that template being invoked.
The times I want the diary template to be invoked are when new file name is like 2020-09-21.mkd
. So I'd like to be able to change the autocmd to something like...
autocmd BufNewFile ~/Documents/wiki/diary/[0-9]{4}-[0-9]{2}-[0-9]{2}.mkd :silent 0r !vimwiki-diary-template.py
But that doesn't work.
And I don't see anything in :help autocmd-patterns
about integers/digits/numerals/numbers.
If I do ls ~/Documents/wiki/diary | grep -E '[0-9]{4}-[0-9]{2}-[0-9]{2}.mkd'
that shows the files I want this template to be applied to. But I don't know how to utilize that regex in the vim autocmd. Can this be done?