philc / vimium

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

Join tab to window #2407

Open rahidelvi opened 7 years ago

rahidelvi commented 7 years ago

W allows us to move a tab to a new window. Is there a key combination where I can do the reverse? That is, can I join a tab to another open window?

There's a Chrome extension called Tab Glue that does it, however, I was hoping this might be possible with vimium.

smblott-github commented 7 years ago

There's no such command currently.

windo commented 7 years ago

Would we need a way to name and/or number windows before adding such a command? I suppose vimium could probably map window ID to an index consistently. So something like moveTabToWindow? At that point, we would also need a goToWindow to be able to effectively manage tabs and windows together.

I'd like this as well - I tend to grow a large number of tabs and occasionally would like to organize them into collections based on tab type (ie: documents/articles I'd like to read) or task (investigating foo, planning vacation). As it stands, it is often too much to eagerly create new windows when starting a new task but once you have 5 tabs open for a task, it's inconvenient to create a new window and move the tabs over too.

Would goToWindow and moveTabToWindow that operate with window "indices" (and current tab for the move) sound like OK commands to implement?

windo commented 7 years ago

I tried working on this and experimented a bit with organizing tabs between windows. The main question is indeed how to identify and target windows once you have more than two. It was somewhat convenient to move tabs between two windows with just two commands: moveTabToFirstWindow and moveTabToLastWindow.

But once you move past 2 windows the UX becomes trickier. I think there are basically two options:

  1. Display list of target windows on Vomnibar
  2. Rather than targetting windows directly, allow moving tabs to "next" and "previous" window

For (1) it is also not clear how to identify the windows even on Vomnibar. By the title of the currently selected tab? By listing all tabs, that is "moveTabToWindowThatHasTheTabYouSelectOnVomnibar"?

For (2) I'm not sure how to handle moving a count of tabs. You wouldn't want to have to keep typing the count (of tabs - although arguably maybe the count should then refer to number of windows back/forward to move a single tab?) when rotating them through windows. Wouldn't want to keep typing 3wn, 3wn, 3wn etc to move 3 tabs through a few windows.

windo commented 7 years ago

Or maybe:

  1. yankTabToMove and moveYankedTabsHere
windo commented 7 years ago

This is what I'm currently trying:

https://github.com/philc/vimium/compare/master...windo:moveToWindow?expand=1

yT to yank some tabs for moving and then p in a new window to move them.

Also R to move some tabs to the last tab move target window used, useful for "repeating" the last tab move for more tabs. Not so sure about this one yet but some sort of single command variant would be helpful when reorganizing many tabs and windows.

smblott-github commented 7 years ago

Great enthusiasm, @windo, but slow up a bit.

Of your ideas above, I like 2 the best.

To me, it's an open question whether we need a whole new command for this. This feature is asked for occasionally, but not a whole lot.

Might there not be a way to implement it as a command option on the moveTabLeft/Right or moveTabToNewWindow? We already have a few commands whose behaviour can be tweaked via options, https://github.com/philc/vimium/wiki/Tips-and-Tricks#custom-key-mappings-with-a-count.

windo commented 7 years ago

moveTabToNewWindow (currently) always creates a new window and lacks a direction option - it sounds confusing to add direction=left/right and new_window=false options to it.

For moveTabLeft/Right is your proposal to add a 'move_window=true' option to them that rather than moving the tab left in a window would move it to the previous (by some standard) window? That sounds needlessly confusing to me as well.

So I think we need at the very least a new moveTabToWindow command of some sort.

As for the UX, I'll try out different options for a while to see how they work out for my use cases and report back. Will be sure to experiment with (2) as well since that's the one you prefer.

codeanpeace commented 5 years ago

Thoughts on one of these workflows?

Append tab to target window:

  1. pressing a new shortcut to moveTabToTargetWindow
  2. pop up the Vomnibar tab selection window listing the active tab of each window in a format similar to Vomnibar.activateTabSelection
  3. select a window to append the current tab to

Move tab next to target tab:

  1. pressing a new shortcut to moveTabAfterTargetTab/moveTabBeforeTargetTab
  2. pop up the Vomnibar tab selection window similar to Vomnibar.activateTabSelection
  3. select a tab to move the current tab next to
kovasap commented 5 years ago

I'm very interesting in seeing any way to move tabs between windows implemented!

gdh1995 commented 5 years ago

In my customized Vimium (named Vimium C - https://github.com/gdh1995/vimium-c), there's a command of moveTabToNextWindow, and it moves the current tab window by window - a little naive, but at least works. If you like you may have a try.

It also has moveTabToIncognito to re-open a tab in a incognito window, and joinTabs to move all tabs into a current window.

markschwarz commented 5 years ago

If this was available in vimium I'd use it! Is a merge to this repo possible?

codeanpeace commented 5 years ago

Hoping this gets implemented sometime, but in the meantime I'll be trying out this chrome extension Tabbo I just found that looks promising.

d3adb5 commented 2 years ago

Has this been implemented already and someone forgot to close the issue, or am I just very late to the party in expressing my interest in this?

Currently I rely on the mouse to move tabs across windows. Took me a while to learn there were commands to move tabs up and down on the tab list, and they're now happily mapped to < and >, but moving things across windows would be nice.

Sometimes I want to switch to a page already in a tab, but present in another window, in another workspace. It would be neat to have a T that "pulls" tabs not in the current window into the current window. That would suffice to me, really.

fanurs commented 2 years ago

Just a daily user of vimium, here to express my interest in having this feature! 😎

gliptak commented 1 year ago

3925

valentingregoire commented 1 year ago

Wasavi has it as well, it's a very similar extension. I really miss this feature with Vimium.

eggbean commented 1 year ago

I'm using this extension as a stop-gap. I have set Shift-Alt-m to activate it to move the current tab to the next window. Do it again for the next window after that. It cycles back to the original window. Multiple tabs which can be shift/ctrl-click selected with the mouse can also be moved.