Emacs vs Vscode

Posted by on 19 February 2019

I haven't really been using Emacs for all that long. I'm really a VIM user when it comes down to it, but there is one thing that vim is missing, a standardized package manager and a package repository. Sure there are package managers and I guess you could count vim.org/scripts as somewhat of a repository but generally speaking I find myself googling for some functionality and finding a repository in Github that I can pull in with one of the various different package managers that have sprung up to fill the gap. So what is a VIM user to do. I'm hooked on the modal modes and keybindings, and I've tried several other editors. My first requirement for a new editor is that it must have VIM bindings or its a non-starter.

A few years ago I stumbled upon Spacemacs which is exactly what I didn't know that I was looking for. Spacemacs is called an Emacs distribution, but really it is Emacs proper, it just has a massive configuration that transforms it into... something else. Emacs has a package repository called melpa.org and it is quite tolerable and there is a package manager builtin to interface with it. What was amazing about Spacemacs is that I have tried Emacs before, but eventually gave up on it, however with Spacemacs inclusion of "evil-mode", I was immediately productive! I have tried many VIM emulators over the years but evil-mode is hands down the closest thing to VIM other than VIM itself that I have found. My fingers type in commands and evil-mode responds appropriately. Usually there is that one thing that's missing or not quite right that drives you crazy, but evil-mode does whats written on the tin, and it does it very well. It wasn't long after using Spacemacs that I discovered org-mode and now there is no turning back. VIM has no solution for org-mode, in fact I dare say no one does, there is no editor, or IDE even that has anything even close. I was using a VIM add-on called vimwiki to keep notes on before I found Spacemacs, but org-mode is so much better. I like using tables to list keybindings and with vimwiki I was constantly reformatting things as I would add new commands, vim-mode handles all of that for you. Once I knew I was going to be living in Emacs for a long while I decided that the Spacemacs configuration was a little too heavy for me and I really wanted to learn more about Emacs so I scrapped the Spacemacs config and rolled my own, and yes I did learn quite a bit that I would never have learned otherwise.

About a year or so ago I discovered VS Code. Since it was all the buzz I had to give it a try. VS Code has nice builtin package support and an online repository they call the Marketplace. Of course step number one was to find the VIM bindings which it does have, in fact there are several extensions for that. The one I found was OK, but it had a few quirks, I believe the most annoying ones have been addressed at this point and things are coming along very well. VS Code is most certainly a capable editor and I really can't say that I have anything against it. For me it just comes down to the hotkeys. I try never to use the mouse, I try to do as much as I can with the keyboard, that is why VIM has always appealed so much to me. With it's philosophy on the home row and its modal design, I can really get things done. Every editor has a certain set of hotkeys for things and since I've been using Emacs for the last couple of years, I've spent a lot of time learning how it works. I can get 85% of what I need to done with VIM bindings alone, but it's that other 15% that I now have down to muscle memory. So, while I can get most of what I need to done with just the VIM bindings in VS Code there are still some minor annoyances like :bd doesn't close a buffer (or at least it didn't last I used it), which means I have to either learn a new hotkey, or ugh...reach for the mouse. So I had to sit down and decide whether or not there was a reason to learn these new hotkeys or just stick it out with Emacs. Mind you, I'm perfectly satisfied with Emacs in evil-mode, I just wanted to see what all the buzz was about. VS Code has a page Why VS Code, so I thought I would see if it offered anything I wanted or needed that I didn't have in Emacs. Below I've made a list of items from that page as well as features that I use that I find useful in Emacs:

FeatureVs CodeEmacsDo I use it?
macOS, Linux, and Windowsxxx
Debugx(yes, but I prefer Chrome devtools)
Syntax highlightingxxx
Code completionxxx
Code navigationxxx
Code refactoringxxx
Make it your own (addons)xxx
Support for JavaScriptxExtensionx
Support for TypeScriptxExtensionx
Support for JSX/ReactxExtensionx
Support for HTMLxExtensionx
Support for CSSxExtensionx
Support for SCSSxExtensionx
Support for LessxExtension
Support for JSONxExtensionx
Support for other languages(limited)xx
Uses Electronx
Native Appx
CalculatorExtension(advanced scientific expressions)x
VIM bindingsExtensionevil-modex
Git integrationxxx
Self documentingxx
Configuration/Addon languageJavaScriptElispx
View keystroke history?xx
Hotkey window/buffer support?xx

Being primarily a frontend JavaScript developer I don't see any value in the builtin debugger, however back before you could debug node with the Chrome devtools I saw that as a huge feature. Now I think I would prefer the Chrome devtools debugger even for node development simply because I live there every day and I am very familiar with them and they work very well. So needless to say I decided to stick it out with Emacs because I didn't really find a compelling reason to switch to something new, vim-bindings need to bake a little more as does support for other languages. Who knows, maybe in 40 years VS Code will also be an amazing editor :)

Tags: #emacs #vscode

Categories: #technology