Macos – Keyboard shortcut to open new tab next to current tab in Google Chrome

browser-tabsgoogle-chromekeyboard shortcutsmacos

Is there a keyboard shortcut (or is there a way to create one without any extensions or third-party stuff) that opens a new tab next to the currently open tab?

For example, let's say I have 10 tabs in Chrome and I have tab 3 open. Is there a shortcut to open a new tab and have it be inserted in the tab 4 spot instead of being added at the end of the list of tabs (tab 11 spot in this example)?

I like being able to quickly open a new tab with command+t, but sometimes it is a pain to drag/rearrange my open tabs.

Best Answer

It looks like I've found a solution.

This blog post from August 26, 2011 describes how to open the next tab using the built-in browser tools.

Here is a quote from there (with small edits):

  1. Go to Chrome's Options / Preferences screen (click the wrench icon on the browser toolbar then select Options or Preferences -- whichever appears on your system).
  2. You'll find yourself in the "Basics" preference page, which should have a "Search" section. Click on the Manage Search Engines... button.
  3. You'll see a list of your custom-built search engines for various sites (if curious, read about Chrome's search engine configuration). At the bottom of the screen, find the set of empty fields for adding a new search engine.
  4. In the first field (labelled "Add a new search engine"), enter Open new tab or something similar. The words you choose are not important -- make them meaningful to you so they'll trigger your memory if you go back into this screen any time in the future.
  5. In the second field (labelled "Keyword"), enter a single word or single letter or a sequence of letters (no spaces nor punctuation). You'll be typing this every time you want to open a new tab to the immediate right, so short and memorable is good. I use tt
  6. In the third field (labelled "URL with %s in place of query"), enter exactly this text including the semi-colon at the end: javascript:window.open();
  7. Click anywhere outside the fields to "save" your entry.

That's the end of the set up. Now whenever you want to open a new tab next to your current tab, you can do this:

  1. Move the keyboard focus to the address bar (Ctrl-L or Cmd-L).
  2. The entire current address should be highlighted, but if not, highlight it all (Ctrl-A or Cmd-A).
  3. Type the keyword you chose in step 5 above -- e.g., tt then Space (or Tab) and hit Enter or Return.

Once you get used to doing this, you'll be able to do it very quickly:

Cmd-L tt Space (or Tab) Enter

The new tab will open immediately to the right of your current tab. Your current tab will not be affected except that the URL might have disappeared from the address bar; if you want to see the URL again, just reload the page (or press Esc).

There is also a comment there telling how to do it using the bookmark:

You can use the same technique to add a button in the Bookmarks Bar.

  1. Open Bookmark Manager.
  2. Select the Bookmarks Bars folder
  3. Select Organize > Add Page.
  4. Name the new page "New Tab" or something similar.
  5. In the URL field, add the javascript mentioned in the above post:

javascript:window.open();

You should now have a clickable button to open a new tab.

From myself I will add that if the first parameter in window.open() is a link to the search engine with the pattern %s, then you can perform a search at the same time as opening a new tab.

Here is my example:

javascript:window.open('https://www.google.com/search?q=%s');

Here is the sequence of actions to use this feature:

Cmd-L tt Space (or Tab) Search query Enter

Screenshot

Related Question