Tip #1470: Status line to display more information
tip karma |
Rating 6/13, Viewed by 4272
|
Read and edit this tip on the
Vim tip wiki.
The wiki may have a more recent version of this tip.
created: |
|
January 12, 2007 21:31 |
|
complexity: |
|
basic |
author: |
|
Vijayandra Singh |
|
as of Vim: |
|
5.7 |
set statusline=%<%f\ %h%m%r%=%-20.(line=%l,col=%c%V,totlin=%L%)\%h%m%r%=%-40(,bytval=0x%B,%n%Y%)\%P
displays line number,hex value under curser,total lines %position in file with text too.modify it and if you find useful
just paste it in vimrc file
<< Ctrl-N completion for XML/XSLT attributes |
VIMRC >>
Additional Notes
[email protected],
January 13, 2007 6:59
|
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()}
fu! 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
endf
fu! CurTime()
let ftime=""
let ftime=ftime." ".strftime("%b,%d %y %H:%M:%S")
return ftime
endf
|
anon,
January 13, 2007 18:00
|
slr.vim (vimscript#1501) is useful too, it allows the setting of multiple status lines provides macros to switch between them.
|
|