Keyboard shortcut to open new tab next to current tab in Google Chrome
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):
- 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).
- You'll find yourself in the "Basics" preference page, which should have a "Search" section. Click on the Manage Search Engines... button.
- 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.
- 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.- 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
- 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();
- 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:
- Move the keyboard focus to the address bar (Ctrl-L or Cmd-L).
- The entire current address should be highlighted, but if not, highlight it all (Ctrl-A or Cmd-A).
- 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) EnterThe 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.
- Open Bookmark Manager.
- Select the Bookmarks Bars folder
- Select Organize > Add Page.
- Name the new page "New Tab" or something similar.
- 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
I ended up installing the Duplicate Tab Shortcut extension, which allows me to use shift
+option
+d
to duplicate the current tab and the duplicated tab appears to the immediate right of the previous tab.
Update: This extension also supports a keyboard shortcut to open a new blank tab directly to the right of the current tab! Thanks @Oliver Joseph Ash for pointing that out.
On Mac, you can assign Cmd + T
to do this.
Based on Vadim's solution, after creating the bookmark, go to Settings -> Keyboard -> Shortcuts -> App shortcuts, and create one entry of of the book mark name, for instance:
This is exactly what I was looking for.