VSCode + vim-mode + emacs keybindings on OSX = ❤️

I love vim. But I also love VSCode. And as far as OS goes, I'd never trade OSX for anything else, as the combination of quality hardware and stable software based on Unix makes it a developer's heaven.

Today, I'm going to present you what I think is the perfect choice as far as editor/IDE setup goes, at leat for me.

vim is amazing

When I learned vim two years ago, my life as a developer changed. I was able to programatically edit code, and way faster, after a few days of getting used to vim that's it. From a few commands introduced at the beginning, to "thinking the vim way" a few months later, I never regretted that choice, as it made me more efficient as a developer. Especially now that I switched from 15 years of 2-fingers 110WPM typing (yes, yes, that's a thing..) on some horrible french keyboard layout called AZERTY, to 10-fingers touch-typing on ISO QWERTY.

Visual Studio Code is amazing

Visual Studio is the best editor out there in my opinion. Microsoft positioned themselves in a very smart and flexible way : They view the whole editor/IDE spectrum not as two opposite points, but a slider. And they view VSCode as being on the middle-left as the slider, but they allow you to make it go more towards the right of the spectrum by installing plugins. Using it is a breeze, as you can customize it to fit your needs, and there are a lot of really-well thoughts features in it. Plus, it's open-source and that's a plus for any piece of software in my opinion, I always use the open-source alternative of anything if it's of a good quality of course.

vim-mode in VSCode

This one is pretty self-explanatory. It's just a vim emulation plugin that you can install in your editor (not only VSCode, there are some for every major editor/IDE out there) to reap the benefits of vim keybindings, while using a modern editor/IDE. You might miss a very few specifics features, i.e certain commands and remappings won't work but overall you get most of the vim behaviour. The idea is to then mix it with your editor features, for example CMD - SHIFT - P to open the command pallette on VSCode. You get the best of both worlds.

Mac OS has system-wide emacs keybindings

There is something that very few people know : OSX text fields use emacs keybindings for the edition. What does that mean ?

It means that from within any text field in the OS you can use emacs keybindings, such as :

CMD - Arrow left = Go to the beginning of the line CMD - Shift - Arrow left = Go to the beginning of the line Option - Arrow left = Move cursor back one word Option - Shift - Arrow left = Delete one word backwards

And more

Not only is it useful system-wide but you can also use this when editing code. There is something I really enjoy, although it might get me hated by vim purists : Navigating while on insert mode using the afore-mentioned keybindings. I know, I know, you're not supposed to navigate in insert mode, that's why we use jkfd and not arrows. But why not ? If you can use emacs keybindings to navigate inline instead of having to quit insert mode, navigate, and go back into insert mode, why not use that possibility ? If I'm on normal/visual mode, I'll use vim navigation/edition, but if not, emacs to the rescue.

I find it to be an extreme timesaver, and the combination of VSCode commands, vim commands and emacs commands make for one of the most productive code editing environments I could ever dream of !

If you're a vim purist reading this : I'm also sometimes navigating using the mouse. Burn the witch, right ?