How to never touch your mouse again 🐭
Tags: productivity, vscode
Published: 2020-08-18 08:12:42

# 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](https://dev-to-uploads.s3.amazonaws.com/i/1k9qovdvro6fbvac141x.png)

Here is [a link](https://gist.github.com/oguimbal/f57106c9597ee65e16dda4e36627aa76) 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](https://www.autohotkey.com/), 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](https://gist.github.com/oguimbal/6953f38c01a94b5e33eb36499950dbd2) 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](https://dev-to-uploads.s3.amazonaws.com/i/k0aoseuilkcnyf5lcwwn.gif)

For this, I highly recomend the [jumpy](https://marketplace.visualstudio.com/items?itemName=wmaurer.vscode-jumpy) vscode extension, which does just that using your keybard.

### Switcheroo (Windows only)

`ALT+Tab` is quite frustrating... try [switcheroo](https://github.com/kvakulo/Switcheroo): Press `ALT+Enter`, then just type the window name you want to jump to 🎉

![switcheroo](https://dev-to-uploads.s3.amazonaws.com/i/hstm1id0jidmnsdqv3bc.png)

### For those who want VIM bindings:
There are several extensions that will turn your vscode experience in something like VIM. Read [this article](https://dev.to/karlredman/navigate-your-vscode-like-its-1999-the-vim-way-3632) to know more about it.


### [edit] Vimium

If you want to control your browser mouseless, give a try to [Vimium](https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en) (or [here](https://addons.mozilla.org/en-US/firefox/addon/vimium-ff/) for Firefox).

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jascks6fn4atkgmj768y.png)