Skip to content

Instantly share code, notes, and snippets.

@kien
Created October 30, 2011 11:50
Show Gist options
  • Save kien/1325823 to your computer and use it in GitHub Desktop.
Save kien/1325823 to your computer and use it in GitHub Desktop.
" Timestamping {{{
function! s:LastModified()
if &modified
let cursor = getpos(".")
sil! undoj
keepj exe '1,'.line("$").'s#^\(.\{,10} Last Modified « \)[^«»]\+\( »[^«»]*\)#\1'.
\ strftime('%a, %d %b %Y %X').'\2#e'
cal histdel("search", -1)
cal setpos(".", cursor)
endif
endfun
au BufWritePre * cal s:LastModified()
" Last Modified « Fri, 12 Apr 2011 6:24:51 PM »
"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment