Modified .vimrc and md template to match new markdown format
I started using Visual Studio Code for markdown notes and I'm trying to keep the markdown files as agnostic as possible. Vim will now match the frontmatter style of VSC and (to an extent) Notable
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
:insert
|
||||
---
|
||||
|
||||
# Title
|
||||
|
||||
Created:
|
||||
|
||||
Updated:
|
||||
|
||||
## Summary
|
||||
|
||||
|
||||
tags: [ untagged ]
|
||||
title:
|
||||
created:
|
||||
|
||||
---
|
||||
|
||||
## Reference(s):
|
||||
# Title
|
||||
|
||||
## Summary
|
||||
|
||||
___
|
||||
|
||||
## Reference(s)
|
||||
|
||||
|
||||
6
.vimrc
6
.vimrc
@@ -251,9 +251,11 @@ autocmd bufWritePost,filewritepost *.py execute "normal `a"
|
||||
" ==> Templates: markdown documents (.md, .mkd)
|
||||
|
||||
autocmd BufNewFile *.md,*.mkd so $HOME/.vim/templates/md
|
||||
autocmd BufNewFile *.md,*.mkd exe "g/Created:.*/s//Created: " .strftime("%c")
|
||||
autocmd BufNewFile *.md,*.mkd %s/title:.*/\='title: '.expand('%:r')/e
|
||||
autocmd BufNewFile *.md,*.mkd %s/\# Title.*/\='# '.expand('%:r')/e
|
||||
autocmd BufNewFile *.md,*.mkd exe "g/created:.*/s//created: " .strftime("%c")
|
||||
autocmd BufWritePre,filewritepre *.md,*.mkd execute "normal ma"
|
||||
autocmd BufWritePre,filewritepre *.md,*.mkd exe "g/Updated:.*/s//Updated: " .strftime("%c")
|
||||
"autocmd BufWritePre,filewritepre *.md,*.mkd exe "g/Updated:.*/s//Updated: " .strftime("%c")
|
||||
autocmd bufWritePost,filewritepost *.md,*.mkd execute "normal `a"
|
||||
|
||||
" ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user