January 18, 2021

Chrome Customization: Ctlr+Tab to switch to last Tab

I was struggling to switch between two Tabs in Chrome, having opened many.
I share here my final solution.

Problem description

Switching Tabs in Chrome with Ctrl+Tab will only switch to the next opened Tab and not the last viewed/most recent Tab.
I would prefer Ctrl+Tab to have the same behavior as Alt+Tab for Windows i.e. switch to the last used Tab or most recently used (MRU) Tab.

(I am not the only one looking for this. See for example this SuperUser question https://superuser.com/questions/402095/switching-back-to-last-used-tab-on-chrome)

Solution using QuickKey Chrome Extension


To overwrite the Hotkey with Ctrl+Tab see https://fwextensions.github.io/QuicKey/ctrl-tab/

This is a clever solution that doesn't require an AutoHotkey script running (see below) but just to run onetime some code in the Chrome command window (Ctrl+Shift+J)

Other Solution Tried using Recent Tabs Extension

Install the Chrome Extension Recent Tabs (Chrome Web Store)

Customize the Hotkey to switch. 
Go to Chrome Menu: More tools->Extensions
Click on the top left Extensions -> Keyboard Shortcuts

Look for Recent Tabs extension
Set the hotkey

It is not possible to assign here Ctrl+Tab
I have chosen Ctrl+Right Arrow

But with AutoHotkey you can remap this key to Ctrl+Tab. (This is the workaround provided by the CRX Author Jason)

Unfortunately with the Recent Tabs extension you can not have both mode running: one hotkey to switch and the popup window to select the Tab.

AutoHotkey Remap Hotkey

With AutoHotkey you can easily remap hotkeys.

; Remap Hotkeys
#IfWinActive ahk_exe chrome.exe 
^Tab::Send, ^{Right}

Adapt the ^{Left} to the hotkey you have defined in the Chrome extension to switch to last recent Tab.

References

QuicKey – The quick tab switcher - Chrome Web Store

No comments:

Post a Comment