Fandom

Vim Tips Wiki

Put the indentation level on the status line

1,624pages on
this wiki
Add New Page
Talk0 Share

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.

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/

Also on Fandom

Random Wiki