Vim Tips Wiki
(change "anon" author to blank; trim "created" date; minor manual clean)
(Insert TipProposed template + minor manual clean)
Line 3: Line 3:
 
|id=1472
 
|id=1472
 
|previous=1470
 
|previous=1470
|next=1479
+
|next=1483
 
|created=January 13, 2007
 
|created=January 13, 2007
 
|complexity=basic
 
|complexity=basic
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
Put in your [[vimrc]] file:
+
Put in your [[vimrc]]:
   
 
<pre>
 
<pre>

Revision as of 03:53, 6 January 2010

Tip 1472 Printable Monobook Previous Next

created January 13, 2007 · complexity basic · version 5.7


Put in your vimrc:

set statusline=%<%f%<%{FileTime()}%<%h%m%r%=%-20.(line=%03l,col=%02c%V,totlin=%L%)\%h%m%r%=%-30(,BfNm=%n%Y%)\%P\*%=%{CurTime()}
set rulerformat=%15(%c%V\ %p%%%)
"set rulerformat=%<%f%<%{FileTime()}%<%h%m%r%=%-20.(line=%03l,col=%02c%V,totlin=%L%)\%h%m%r%=%-30(,BfNm=%n%Y%)\%P\*%=%{CurTime()}

function! FileTime()
  let ext=tolower(expand("%:e"))
  let fname=tolower(expand('%<'))
  let filename=fname . '.' . ext
  let msg=""
  let msg=msg." ".strftime("(Modified %b,%d %y %H:%M:%S)",getftime(filename))
  return msg
endfunction

function! CurTime()
  let ftime=""
  let ftime=ftime." ".strftime("%b,%d %y %H:%M:%S")
  return ftime
endfunction

Comments

This gets the file's mtime on each update. Isn't that somewhat of an overkill?