Vimium: <number>g to jump to tab

Created on 14 Aug 2011  ·  9Comments  ·  Source: philc/vimium

Feature request: use <number>g to jump to tab <number>. So 1g would jump to the first tab from the left, 5g to the fifth tab etc. -1g, -2g, -3g etc. could jump to the first/second/third etc. tab from the right.

Most helpful comment

2g0 takes you to the second tab. 3g0 the third. And so on.

Remap firstTab if you want a different key binding.

All 9 comments

Yeah, currently this simply emulates hitting ctrl + tab <N> times, where <N> is whatever you type before gt.

in Chrome you can use "Ctrl + Number", if the number is 1 it goes to the first tab, 2 to the second, etc.
But as a VIM user I don't like to press Ctrl, so I would to have what you suggested.
But I didn't like the "-1g"..
What I think that should be done is "g1", "g2".. instead of "1g", "2g".. just it.

But lets see other's opinions, and I'll see if I can be able to help on this issue.

g<num> is definitely more appropriate than <num>g -- a preceding number is already being used to indicate command repetition. I think this might be a good solution to issue #314.

@ilya suggested "g0" for the first tab, but we need to be careful not to introduce annoying inconsistencies with Chrome's native shortcuts. I've tended to default to be more like Chrome than Vim when there's a direct conflict between the two. I'm not sure which is best for this feature.

A little more context: @ilya's suggestion was made in response to my original statement that g$ was awkward to press, and that we could try g0 for the last tab and g1 for the first tab.

I agree with @philc that the inconsistency isn't very pleasant. Moreover, it's nice to have the keyboard layout mirror that of the tabs -- i.e. to have numbers on the left of the keyboard map to leftmost tabs. How just doing what the OP of this bug describes? g-1 would then be the last tab. It's not the most elegant key combo, but given that g$ is already three keystrokes, this doesn't seem to make it much worse -- in fact, since none of the three keystrokes in g-1 is a modifier, there is less hand-contortion required. More importantly, this switching strategy gives us the flexibility to jump to a bigger range of tabs.

@philc and @int3, g0 and g$ already exist, I did it.
@int3, my english is not that good, but for what I read you're suggesting g-1 for the last tab, correct? and for other tabs, like the fourth tab?

Closing due to inactivity -- I haven't heard this feature request in a few years and I don't think it's urgent given that Chrome has its own shortcuts.

I think this is still useful especially for non-chrome users. I got used to Chrome's ctrl# shortcut but Firefox doesn't have it. g$ and g0 are helpful but not quite what I'm looking for.

2g0 takes you to the second tab. 3g0 the third. And so on.

Remap firstTab if you want a different key binding.

Was this page helpful?
0 / 5 - 0 ratings