Wikia

Vim Tips Wiki

Put the indentation level on the status line

Talk0
1,613pages on
this wiki
Tip 477 Printable Monobook Previous Next

created May 20, 2003 · complexity basic · author sputnik · version 5.7


Related to VimTip303

In vimrc:

set statusline=<Whatever your status is>\t%{ShowTab()}\ %P
fu ShowTab()
  let TabLevel = (indent('.') / &ts )
  if TabLevel == 0
    let TabLevel='*'
  endif
  return TabLevel
endf

CommentsEdit

fu ShowTab()
  return (indent('.') / &ts )
endf

s/ts/sw/

Around Wikia's network

Random Wiki