Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:44:47+00:00 2026-06-07T04:44:47+00:00

Vim is very productive editor and I enjoy using it everyday, but I’ve found

  • 0

Vim is very productive editor and I enjoy using it everyday, but I’ve found that moving between tabs takes more time than it should.

When I want to switch to another tab I often repeat gt or gT multiple times. Vim provides a better way to reach required tab – n + gt, where n is tab number. But to use it you should count tab number first. It quickly become boring if you open a dozen of tabs.

I think it would be nice to enumerate tabs. A single number on each tab in front of file name, something like this:

1 Readme | 2 main.c | 3 main.h | 4 process.h

I hope it is possible to configure vim to do this by editing config or using some plugin.

Is there a way to achieve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:44:48+00:00Added an answer on June 7, 2026 at 4:44 am

    You can use the tabline option for setting the label of the tabs in console mode of vim.
    See the help at :h setting-tabline which also shows a very basic minimal example, which you can tweak to your need, e.g. for what you want, I would use something like this:

    fu! MyTabLabel(n)
    let buflist = tabpagebuflist(a:n)
    let winnr = tabpagewinnr(a:n)
    let string = fnamemodify(bufname(buflist[winnr - 1]), ':t')
    return empty(string) ? '[unnamed]' : string
    endfu
    
    fu! MyTabLine()
    let s = ''
    for i in range(tabpagenr('$'))
    " select the highlighting
        if i + 1 == tabpagenr()
        let s .= '%#TabLineSel#'
        else
        let s .= '%#TabLine#'
        endif
    
        " set the tab page number (for mouse clicks)
        "let s .= '%' . (i + 1) . 'T'
        " display tabnumber (for use with <count>gt, etc)
        let s .= ' '. (i+1) . ' ' 
    
        " the label is made by MyTabLabel()
        let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
    
        if i+1 < tabpagenr('$')
            let s .= ' |'
        endif
    endfor
    return s
    endfu
    set tabline=%!MyTabLine()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still very new to vim but I've noticed that files with -*- mode:
My vim is very slow to switch tabs ( :tabnext ) when i've fullscreened
I am using Vim to edit a Java file, but I find the way
I'm now switching to VIM from TextMate. I found ^+W in INSERT mode very
I use Vim with ctags for development. I found ctags to be very useful
I would like to make vim my C++ editor. I have very little experience
I am using vim/gvim for 4 months already and now I found a way
Hello i have recently started using vim editor ( actually the plugin for netbeans
This is very similar to: Vim auto commands: writing a read-only file? Except that
I've been using Vim for a while now and love it, but one thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.