Entering and exiting full-screen in YouTube with Vimium
March 17, 2022•281 words
Vimium is a browser extension that lets you browse the internet in web browsers with the keyboard, and provides a number of keyboard shortcuts to do so.
But, in the odd chance the web page supplies its own set of keyboard shortcuts, the extension and the page's shortcuts can conflict if using the same keys. One of these cases is the YouTube player, so if you'd like to enter/exit full-screen on YouTube while keeping the extension enabled, this article is for you!
YouTube and Vimium share two keybinds, f
and esc
, which has unintentional side-effects when you try to enter full-screen with f
and exiting out of full-screen with esc
.
To do default YouTube commands with Vimium, the extension features an insert mode (using the i
key); which lets you use the page's keybinds instead. So, to open the YouTube full-screen player the command would be i
, then f
. But, a UI label still appears overlaying in the corner in front of the full-screen content, which I found distracting.
To be able to close this "Insert" overlay without also exiting out of full-screen, I created a custom key binding to alt
+ i
in Options -> Custom key mappings:
mapkey <a-i> <c-[>
After adding this to your key bindings, make sure to hit Save to apply those to the extension!
Also: See https://github.com/philc/vimium#keyboard-bindings if you're curious on what these keybindings mean.
So basically, to enter full screen, you would do use these three key commands in order:
i
f
alt
+i
I chose alt
+ i
as it's pretty ergonomic, as the thumb is pretty close to the alt key already when hitting the f
key.