From bdea77f86a7cdfa09836d1e63c622e224e308240 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sun, 31 Mar 2019 23:17:02 +0100 Subject: [PATCH] Auto update `Last change` in vim help files --- plugin/autocmds.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/autocmds.vim b/plugin/autocmds.vim index 4386d00..552e119 100644 --- a/plugin/autocmds.vim +++ b/plugin/autocmds.vim @@ -8,6 +8,9 @@ augroup benieAugroup " Highlight conflict markers in any filetype au FileType * call matchadd('Todo', '^\(<<<<<<<\||||||||\|=======\|>>>>>>>\)\s\ze.*$') + " Update `Last change: ` on write then jump back previous position + au BufWritePost *.txt 1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e|norm!`` + " Read template into buffer then send line 1 to the black hold register au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _ " Attempt to expand snippet named `_template` if it exists