I have a task where I have to take a look at 211 ruby files. I need to know how many tabs are open. Is there any way I can get some statusbar or something similar that can tell me how many tabs are open?


Vim has a a built-in help functionality:

:help tabpagenr()
:help 'ruler'
:help 'statusline'

In order to display the number of tab pages in your status line, you may want to add %{tabpagenr('$')} to your statusline or rulerformat options. For example,

:set ruler
:let &rulerformat='%39(%-6{strpart(&ft,0,5)}%5.5b%6.6(<%B>%) %5.5l,%-7.7(%.3c%.4V%) %6{tabpagenr(''$'')}T%)'

On the other hand, the Vim I am running won't let me open more than 10 tabs at the same time...

  • can you explain a bit more. i am a new vim user and you can guess what stage i am in :) – Bishisht Bhatta Dec 10 '16 at 19:24
  • @BishishtBhatta: I have edited the answer. – AlexP Dec 10 '16 at 19:57
  • Thanks bro. Also how can i put these into the vimrc? – Bishisht Bhatta Dec 11 '16 at 15:01
  • @BishishtBhatta: Of course. Not need for the leading : in .vimrc. – AlexP Dec 11 '16 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.