Created
October 30, 2011 11:50
-
-
Save kien/1325823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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