Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions on multiple selected tabs #58

Closed
balta2ar opened this issue Jul 18, 2019 · 10 comments
Closed

Actions on multiple selected tabs #58

balta2ar opened this issue Jul 18, 2019 · 10 comments

Comments

@balta2ar
Copy link

It looks like Vimium-C does not support tab selection. Relativetly recently (probably this year), both Firefox and Chromium were added a feature where you can select multiple tabs with Shift and do an operation on all tabs at once, for example you can select many tabs and close or reload them at once. When I select many tabs and press x to close, or r to reload, only the current tab is closed or reloaded. I guess it could be nice to be consistent with the browser behaviour and execute shortcut on all selected tabs.

@gdh1995
Copy link
Owner

gdh1995 commented Jul 18, 2019

Yes, it doesn not consider about the selected status. But it's mainly because it support "count prefix" to achieve almost the same functionality. For example, if press "5x" (press down 5, release the key, and then press x), Vimium C will close 5 tabs, a current tab and 4 tabs at its right, and for "-5x", the closed will be the current one and 4 at its left.

Besides, it's too inconvenient if a user have to "select" some tabs using a mouse and then press keyboard keys to trigger shortcuts.

@balta2ar
Copy link
Author

balta2ar commented Jul 19, 2019

Count prefix is a great feature, but supporting multiple selected tabs is more about being aligned with the browser native functionaliy, providing smooth user experience. Yesterday it was my first time that I pressed x and I was surprised that x didn't work as I expected. I may be the first user who noticed that, maybe others will find it out as well over time.

too inconvenient if a user have to "select" some tabs using a mouse and then press keyboard keys to trigger shortcuts

Sorry, that's my primary workflow and I have never thought it was inconvenient before you said so :) One downside with "count prefix" that I noticed is that you don't see the tabs you're about to close. In Firefox tabs do not shrink as in Chrome. The tab width stays constant and instead you get to see only a portion of the tabs, but you can scroll them horizontally using mouse wheel. That's what I do. I activate my first tab, then I scroll lots of tabs to the right/left, and while I do that, I see the favicons and part of the titles of the tabs, so I see what's in my selection. Then I press Shift and click on some tab, finishing it with Ctrl-W to close the groups of tens of tabs at once. For me, it's very convenient, visual and interactive.

The point of this issue is to bring the inconsistency that I have noticed to your attention. Personally, I'm fine with the current behaviour as long as I can press Ctrl-W or Ctrl-R, but I thought you might wanted to adjust Vimium-C to match native behavior. So this is purely informational, a "nice to have" feature, but if your vision is different, I can understand, feel free to close the issue. I highly appreciate your time and your effort you've put into this plugin in any scenario.

@gdh1995
Copy link
Owner

gdh1995 commented Jul 19, 2019

Looks reasonable.

Although there've been some discussions about it like philc/vimium#3283 , now I agree with you that it should be "consistent" with browsers.

But, to be honest, it will be a very hard task if to support noncontinuous selected tabs in all commands of Vimium C. So I prefer to add it only for "removeTab". This feature may be ready on version 1.77.* (one ~ two months).

Update: currently I think, removeTab command should ignore other selected tabs if the count prefix is not 1, so what's your idea about it?

I also suggests you try the Vomnibar in tab mode (e.g. map T Vomnibar.activateTabSelection currentWindow), and then you can: select a tab and press Shift+Enter to remove it, and then select another tab to remove.

@balta2ar
Copy link
Author

removeTab command should ignore other selected tabs if the count prefix is not 1

Yeah, it's not clear how to interpret "count prefix" when mutiple tabs are selected. I guess one of the options is to show an error to the user saying "Can't work with mutiple tabs and count prefix". Or maybe just ignore the action.

I also suggests you try the Vomnibar in tab mode

You probably meant Shift-Delete, not Shift-Enter?

I've tried and as far as I understand, it's not exactly the same: the workflow here is that I 1. select a tab 2. press Shift-Delete for each tab. 3. Do 1 & 2 repeatably. With the method above, I could just select tabs and press ctrl-w once. I couldn't find a way to select mutiple tabs in Tab mode and then press Shift-Delete once, please correct me if I missed anything. This doesn't disparage Tab mode in anyway though -- one of the reasons that I switched to Vimium-C is that it supports closing tabs with Shift-Delete shortcut (awesome feature, thank you!).

@gdh1995
Copy link
Owner

gdh1995 commented Jul 22, 2019

Um, yes what I meant is "Shift-Delete", sorry for the typo.

The last weekend I was too tired to update Vimium C, so I may write and release a new version in this week.

@gdh1995
Copy link
Owner

gdh1995 commented Aug 2, 2019

Hello, I've made a test version and you may take a try:

  • vimium_c-1.76.3-chrome.zip
    vimium_c-1.76.3-fx.zip
  • you need to map removeTab like this in order to close those highlighted:
    • map x removeTab highlighted will close all highlighted including the current one
    • map x removeTab highlighted="no-current" will always skip a current tab

@gdh1995
Copy link
Owner

gdh1995 commented Aug 12, 2019

Version 1.76.4 has been released.

@thien-do
Copy link

thien-do commented Nov 1, 2020

@gdh1995 is there a way to "close other tabs" (keep current tab)?

@gdh1995
Copy link
Owner

gdh1995 commented Nov 2, 2020

@dvkndn There's an advanced command named "closeOtherTabs":

  • by default, it closes all other tabs
  • if giving filter="url", then it will only close tabs which have a same URL with the current tab.

@thien-do
Copy link

thien-do commented Nov 2, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants