philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
22.73k stars 2.46k forks source link

Feature request: Navigate tabs in the same way as is done with f #2254

Open tobimensch opened 7 years ago

tobimensch commented 7 years ago

Hi,

I've fallen in love with navigating pages with f. (i.e. entering f and one or two more letters)

I want to have the same kind of navigation for open tabs!

jimmyyentran commented 7 years ago

Have you tried 'T' to search through your open tabs? It's not the same functionality as 'f' but usually typing the first couple of letters finds the right tab.

tobimensch commented 7 years ago

I know, but I think it could be (much) better. :-) No offense. Maybe I'll create a pull request.

krokofant commented 7 years ago

How would this work technically though? I can't find anything relevant in the Chrome Extension docs. The closest would be to change the text in the tab titles but that does not provide the same readability as the T function.

smblott-github commented 7 years ago

@krokofant is probably right. There isn't really an API to do this. We don't know the position of the tabs, so we don't know where to put the hints. Also, some tabs may be in other windows, which may not even be visible.

entering f and one or two more letters

With the way the Vomnibar scores and ranks matches, using T also usually only requires a few characters. But it's also better, because you know the characters to type before hitting T. For example, I know that T thentw will pick out my Twitter tab.

davidrivers commented 7 years ago

I also really like this feature idea.

@smblott-github: I would use this feature mostly by filtering links by title (not number), and having the tab automatically raise focus once (without requiring Enter), as this is how I normally use link hints as well. Perhaps the first (or only) implementation wouldn't require any UI elements for the tab hints, but rather work silently? (Another, more complicated design could overlay a virtual representation of the tabs somewhere on the page, and any styling to indicate filtering feedback.)

Anyway, point is just that I think this feature could be really useful (to at least me), even in a bare bones implementation, and even if it has to be enabled in the settings. I could maybe try and tackle implementing this feature myself, assuming the Vimium codebase is mostly JavaScript (and/or some other familiar technologies). I haven't looked at Vimium source yet, but I was just about to do that to maybe take a look at one of the other UI feature requests.

pblesi commented 2 years ago

Reviving this as I would find the feature to be very useful. I often have many tabs (100+) open with similar titles and sites such that it limits the usefulness of T. I much more often deal with tabs in terms of their position as opposed to their titles. Further, issues with focus capture such as with Google docs, make it difficult to navigate tabs using J, K, etc.

I could see an implementation either updating tab titles or their favicons to indicate the Alphabet to type. I attempted to provide an implementation adapting LinkHints, but my javascript is not good enough to fully implement.

trysten commented 1 year ago

@pblesi I don't think any addon will be able to enumerate visible tabs. Because Vimium doesn't know which tabs are in your view, it's only choice would be to enumerate all of them. I don't think this feature could work for your use case. You probably already knew this, but you can prefix a nextTab or previousTab with a number to jump that many tabs.