If I have opened 4 to 5 tabs in the same window.what is the shortcut to switch from tab1 to tab5/4.Pressing gt
successively can get the work done. Is there any other easy way?
Asked
Active
Viewed 167 times
2
-
Are you using `gvim`? – lurker Apr 05 '14 at 16:31
-
@mbratch I m using both vi and gvim editor – ddpd Apr 05 '14 at 17:28
-
1Alternatively don't use tabs and learn to use [buffers effectively](http://stackoverflow.com/a/21338192/438329) – Peter Rincker Apr 05 '14 at 20:38
-
Checkout https://stackoverflow.com/a/68509806/9384511 – ABN Jul 24 '21 at 12:28
1 Answers
4
Have a closer look at :h gt
, it can be prepended with a {count}
, so to go to tab5, you could hit 5gt and to go to tab4 you could hit 4gt.
Also, you can use gT to go to the previous tab (in the reverse direction), so from tab1 if you'd like to go to the last tab, it's faster to do gT than {count}gt

Dhruva Sagar
- 7,089
- 1
- 25
- 34
-
To facilitate using the count, it helps to put the tab number right in the tabline: http://vim.wikia.com/wiki/Show_tab_number_in_your_tab_line – Ben Apr 05 '14 at 17:41
-
@Ben that's right, and for terminal vim (what I use), you could use this https://gist.github.com/dhruvasagar/9995388 – Dhruva Sagar Apr 05 '14 at 17:50