Good Morning,
This works great on my work computers.
Please install what ever is missing at Sonic so I can use it here.
https://vim.fandom.com/wiki/Insert_current_date_or_time
function! LastModified()
if &modified
let save_cursor = getpos(".")
let n = min([20, line("$")])
keepjumps exe '1,' . n . 's#^\(.\{,10}Last Modified \).*#\1' .
\ strftime('%Y-%m-%d-%H:%M') . '#e'
call histdel('search', -1)
call setpos('.', save_cursor)
endif
endfun
autocmd BufWritePre * call LastModified()
This works great on my work computers.
Please install what ever is missing at Sonic so I can use it here.
https://vim.fandom.com/wiki/Insert_current_date_or_time
function! LastModified()
if &modified
let save_cursor = getpos(".")
let n = min([20, line("$")])
keepjumps exe '1,' . n . 's#^\(.\{,10}Last Modified \).*#\1' .
\ strftime('%Y-%m-%d-%H:%M') . '#e'
call histdel('search', -1)
call setpos('.', save_cursor)
endif
endfun
autocmd BufWritePre * call LastModified()