sponsor Vim development Vim logo Vim Book Ad

basic Tip #477: How to put the indentation level on the status line

 tip karma   Rating 14/12, Viewed by 2333 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   May 20, 2003 14:33      complexity:   basic
author:   sputnik      as of Vim:   5.7

related to vimtip #303

in .vimrc

set statusline=<Whaterever your status is>\t%{ShowTab()}\ %P


fu ShowTab()
   let TabLevel = (indent('.') / &ts; )
   if TabLevel == 0
      let TabLevel='*'
   endif
   return TabLevel
endf

 rate this tip  Life Changing Helpful Unfulfilling 

<< multime errorformat & makeprgs | Copy the search results into clipboard >>

Additional Notes

Anonymous, May 20, 2003 16:50
fu ShowTab()
   return  (indent('.') / &ts; )
endf
Anonymous, May 21, 2003 0:00
s/ts/sw/

;-)
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo