How to never touch your mouse again ๐Ÿญ

Olivier Guimbal - Aug 18 '20 - - Dev Community

VIM ? Well... no thanks.

You may already have met one of those extremists which have explained to you how productive VIM is compared to newbie editors like vscode or other modern useless shit.

To me, this always have sounded like some sort of hell-yea-i-am-a-real-geek nonsense. In perticular, they often hightlight the fact that VIM is highlly customizable. Weeeelll, yes. That's right. Or at least that was right: vscode (or other modern alternatives), is also highly customizable, in a way more user friendly fashion.

However, if like me you have been writing code for decade(s), you might have noticed (or not?) that one of the things that break your flow is to constantly switch between keyboard, arrow keys, and/or your mouse. When you have a burst, you may feel like hell-yea-my-hands-are-flying, but in the end, you spend a lot of time not typing actual code. That is one of the arguments of VIM-extremists, and I must say, this is the one that seduced me the most.

What if I dont wanna spend 32752 hours learning/configuring VIM ?

I'll share with you the two ways I achieved that.

Configuring vscode alone

Vscode shortcuts customization is awesome. You can do almost anything with it.

shortcuts

Here is a link to my key bindings, so you can pick what's best for you (โš  my keyboard is AZERTY).

A config like this one allows you to navigate your code without moving your hands even slightly:

  • use ALT+I/J/K/L/U/O/Y/H/M/รน to move around
  • same shortcuts with SHIFT pressed to select code
  • use ALT+Q/S/D/Z to switch between panes
  • use ALT+SHIFT+Q/S/D/Z to move code panes around
  • use ALT+,/; to switch between tabs
  • ... it also contains some other useful stuff check it out.

It takes several hours to get used to not touching your mouse, but there is no going back: It really worthes it.

However, when you configure this kind of shortcuts, it can feel a bit frustrating to edit text elsewhere "the old way" (notepad, word, or even in your browser).

That is the why of this next section:

System-wide configuration using AuthoHotKey (Windows only, sorry)

If you dont know autohotkey, it is a small software that allows you to write scripts that you can bind to keyboard shortcuts. It has a quite ugly syntax, but it makes it really easy to remap keys and interact with windows.

This autohotkey script will allow you to have almost the same experience moving around text as briefly described in the previous section, but system-wide.

(nb: It also contains a remapping of the F1 key that hides/shows Windows Terminal)

Other utilities

Jumpy

Moving around code using keyboard is nice, but you may feel like it is frustrating not to jump directly at a precise location visible on your screen (you'll want to click on this location).

jumpy

For this, I highly recomend the jumpy vscode extension, which does just that using your keybard.

Switcheroo (Windows only)

ALT+Tab is quite frustrating... try switcheroo: Press ALT+Enter, then just type the window name you want to jump to ๐ŸŽ‰

switcheroo

For those who want VIM bindings:

There are several extensions that will turn your vscode experience in something like VIM. Read this article to know more about it.

[edit] Vimium

If you want to control your browser mouseless, give a try to Vimium (or here for Firefox).

It has plenty of shortcuts allowing you to browse pages, navigate bookmarks, open tabs or click links using your keyboard

Alt Text

. . . . . . . . .
Terabox Video Player