m (VIMRC moved to Show file modification time on status bar: Page moved by JohnBot to improve title) |
(Insert TipProposed template + minor manual clean) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=1472 |
|id=1472 |
||
+ | |previous=1470 |
||
− | |title=VIMRC |
||
+ | |next=1483 |
||
− | |created=January 13, 2007 |
+ | |created=January 13, 2007 |
|complexity=basic |
|complexity=basic |
||
+ | |author= |
||
− | |author=Display File last modification time on status bar |
||
|version=5.7 |
|version=5.7 |
||
|rating=18/13 |
|rating=18/13 |
||
+ | |category1= |
||
⚫ | |||
+ | |category2= |
||
⚫ | |||
+ | }} |
||
+ | Put in your [[vimrc]]: |
||
+ | |||
⚫ | |||
⚫ | |||
set rulerformat=%15(%c%V\ %p%%%) |
set rulerformat=%15(%c%V\ %p%%%) |
||
− | "set rulerformat=% |
+ | "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 |
||
− | endf |
||
− | + | function! CurTime() |
|
− | + | let ftime="" |
|
− | + | let ftime=ftime." ".strftime("%b,%d %y %H:%M:%S") |
|
− | + | return ftime |
|
+ | endfunction |
||
− | endf |
||
− | </pre> |
+ | </pre> |
− | |||
⚫ | |||
⚫ | |||
− | |||
− | '''Anonymous''' |
||
− | , January 18, 2007 1:13 |
||
− | ---- |
||
− | so cool |
||
− | |||
− | kbtrace AT yahoo.com |
||
− | , January 15, 2007 3:22 |
||
− | ---- |
||
− | this tips doesn't work for me in vom 7 |
||
− | |||
− | anonym |
||
− | , January 15, 2007 11:30 |
||
− | ---- |
||
− | wow good tip :) |
||
⚫ | |||
− | ernesto schutz |
||
⚫ | |||
− | eschuetz3128--AT--hotmail.com |
||
− | , January 13, 2007 13:44 |
||
---- |
---- |
||
− | <!-- parsed by vimtips.py in 0.461694 seconds--> |
Revision as of 03:53, 6 January 2010
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?