Vim Tips Wiki

Show file modification time and more on status bar

Redirected from VimTip1483

1,624pages on
this wiki
Add New Page
Talk0 Share
Tip 1483 Printable Monobook Previous Next

created January 21, 2007 · complexity basic · author Ace · version 5.7

autocmd BufWrite * call SetStatusLine()
autocmd BufRead * call SetStatusLine()
function! SetStatusLine()
  set statusline=[%n]\ %f\ %(\ \ (%M%R%H)%)\ \ \ %=\t%{ShowTab()}\ \ \ Modified:\ %{Time()}\ \ [%3l:%3L,%2c]\ %p%%\

function! Time()
  return strftime("%c", getftime(bufname("%")))

function! ShowTab()
  let TabLevel = (indent('.') / &ts )
  if TabLevel == 0
    let TabLevel='*'
  return TabLevel

See also VimTip1472.


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.