vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Using map to open new tab and switch to that will open new window instead

Open jkonecny12 opened this issue 7 years ago • 8 comments

Using this custom mapping:

map F LinkHints.activateModeToOpenInNewForegroundTab

won't work as expected. Instead of showing a tab and switching to it, it will open a new window.

This is happening on Vivaldi browser.

jkonecny12 avatar Aug 09 '18 09:08 jkonecny12

Still valid.

pat-s avatar Dec 20 '19 13:12 pat-s

This is because Vivaldi changes (switches) the default actions of Ctrl+Shift+Click and Shift+Click, while Vimium doesn't know it and still simulates Click with Ctrl+Shift

gdh1995 avatar Dec 21 '19 08:12 gdh1995

So apparently the behavior is as follows:

Chrome Vivaldi
Ctrl+Click Open link in new background tab Open link in new background tab
Shift+Click Open link in new window Open link in new foreground tab
Ctrl+Shift+Click Open link in new foreground tab Open link in new window

Personally I prefer Vivaldi's behavior (I normally open in either background or foreground tabs, almost never in new windows). Short of an option to change modifier keys or a Vivaldi-specific fix (Vivaldi's user share among vimium users might not be enough to warrant that), a new unbinded advanced command LinkHints.activateModeToOpenInNewWindow that Shift+clicks would provide a useful workaround. Chrome users would then get a new feature to open links in new windows if they like, and Vivaldi users can have access to normal functionality by swapping LinkHints.activateModeToOpenInNewWindow and LinkHints.activateModeToOpenInNewForegroundTab. In fact, I was surprised to see that LinkHints.activateModeToOpenInNewWindow wasn't already available as it sounds like it would be a trivial extension of current functionality.

debiedowner avatar Dec 03 '20 11:12 debiedowner

The solution to the request is to use newtab="window" option for the LinkHints like this:

map J LinkHints.activateOpenInNewForegroundTab newtab="window"

Taken from here. Works with the recent Vimium-C and Vivaldi.

coordinatio avatar Aug 25 '23 15:08 coordinatio

What is LinkHints.activateModeToOpenInNewForegroundTab? I only see LinkHints.activateOpenInNewForegroundTab as an option.

This works for me on Vimium-C 1.99.99 and Vivaldi 6.5.3206.59:

map F LinkHints.activateOpenInNewForegroundTab

EDIT: Sorry, I thought this was the Vimium-C repo. Now I see that the command names are slightly different.

victorlin avatar Feb 05 '24 19:02 victorlin

Um, in fact I recommend users of Vimium C to try map f LinkHints.activateOpenInNewForegroundTab ctrlShiftForWindow, which is designed to directly fix the behavior on Vivaldi.

BTW, LinkHints.activateModeToOpenInNewForegroundTab should also work in Vimium C - it works as an alias of LinkHints.activateOpenInNewForegroundTab.

gdh1995 avatar Feb 12 '24 13:02 gdh1995

This is still open? Apparently. It did not work for me either. But since I open and switch to the tab immediately 99.9%, I simply installed Activate Tab plugin, and now my F opens a tab and switches to it.

guest73 avatar Apr 27 '24 07:04 guest73