Wikia

Vim Tips Wiki

Changes: Put the indentation level on the status line

Edit

Back to page

(Fix typos)
(Remove html character entities)
 
Line 16: Line 16:
 
In vimrc:
 
In vimrc:
 
<pre>
 
<pre>
set statusline=&lt;Whatever your status is&gt;\t%{ShowTab()}\ %P
+
set statusline=<Whatever your status is>\t%{ShowTab()}\ %P
 
fu ShowTab()
 
fu ShowTab()
let TabLevel = (indent('.') / &amp;ts )
+
let TabLevel = (indent('.') / &ts )
 
if TabLevel == 0
 
if TabLevel == 0
 
let TabLevel='*'
 
let TabLevel='*'
Line 29: Line 29:
 
<pre>
 
<pre>
 
fu ShowTab()
 
fu ShowTab()
return (indent('.') / &amp;ts )
+
return (indent('.') / &ts )
 
endf
 
endf
 
</pre>
 
</pre>

Latest revision as of 08:46, September 29, 2008

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