Created
March 21, 2010 04:44
-
-
Save c9s/339094 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun! BumpVimrcVersion() | |
let lines = getline(1,10) | |
let i = 0 | |
for line in lines | |
let i += 1 | |
if line =~ '^"\s*Version:' | |
let version_str = matchstr(line,'\(Version:\s*\)\@<=[0-9.]\+') | |
let vimrc_version = str2float(version_str) + 0.01 | |
cal setline( i, "\" Version: " . string(vimrc_version) ) | |
elseif line =~ '^"\s*Date:' | |
cal setline( i, "\" Date: " . strftime("%c") ) | |
endif | |
endfor | |
endf | |
aug AutoVimrcVersion | |
au! | |
au BufWritePre .vimrc :cal BumpVimrcVersion() | |
aug END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment