Goodbye VSCode, Hello Emacs Again
hotair.tech
hotair.tech
However worth emphasising:
> VS Code is an excellent IDE and I would recommend any new software developer to use it.
It's refreshing to see a take end like this. He acknowledges VS Code is a good IDE although he feels at home with emacs. This emphasises that he didn't stick with emacs because it is superior but because the cost of switching editors simply wasn't worth it to him.
That said, this reads more like general tips for emacs users rather than a critique of VS Code. So the title is a bit misleading.
Emacs, vim, sublime are mostly text editors. If that’s what you really want: edit code with a whole bunch of shortcuts use that.
If you want a light weight IDE use vscode. Code editors are a subset of IDEs.
Two different things.
One thing I've noticed is there are very few good emac videos tutorials out there, at least compare to VScode and any other IDE.
Its a very powerful tool sure, if you memorize all the hotkeys and commands. But to get to that point requires a lot of memorization and practice, something I don't have the luxury of. Time spent familiarizing myself with a nice GUI interface like VScode to get the same job done is easier.
I almost never cut corners when it comes to adopting tools. I always adopt the simplest tool first, usually this is things like pen+paper, stickynote pads, etc. If the simplest tool suffices for all my needs, I don't upgrade. I believe dumb tools are always better, there's less moving components and more rigidity/opinionation. Plus I can touch and feel it, etc. However, I will always constantly do research and A/B test new tools almost everyday, just to see whats out there.
I think people honestly get too invested in their tools. A tool is a tool, nothing more nothing less. If someones first thought about you is "oh he's that emacs guy!", thats not a good thing.
But I still understand that people have lived and grown up with emacs, and its been something they have nurtured their entire life. They've built optimized workflows for any situation, and memorized hundreds of tidbits for making things work fast. Jumping ship is like tossing away part of your identity, so its not an easy transition.
Emacs actually has a built-in tutorial. It takes an hour or two to go through, if I remember correctly. Most people don't do it, I think, because they think they know how to edit text - you just use the cursor keys and hit the keys you want to insert?
But if you follow the advice in the tutorial and practice over a day or two at a reduced speed, it does actually make a noticeable difference, IMHO.
It's a bit like touch typing. I know plenty of programmers who can't touch type. Yet, in my experience it actually frees a noticeable amount of brain power. But it does take maybe 10-20 hours to learn. So people don't do it.
What VSCode offers on this front that strikes me as a really killer feature is the command palette. It's a great UI - whenever you want to do something, and you're not sure what to do, just hit the hotkey to open the command palette (on Macs it's shift-splat-P) and start typing the name of what you want to do. It'll give you a menu of actions, and, if a hotkey is assigned, show it to you.
It means you never need to leave the keyboard to hunt through menus to find something, and you also don't need to read through endless lists of hotkeys and create Anki flashcards for them just to get yourself pushed over the "I can't get any work done here" phase of the learning curve.
You can use `helm-M-x` from Helm[1] to do the same in Emacs.
Anki should be used for memorizing concepts you understand already not button pressing.
Instead, my new macbookPro (and my first time using macOS), I have dozens of printed out cheatsheet snippets and stickynotes littering the edges of the keyboard. I write down a bunch of hotkeys I can refer to instantly by glancing down at my keyboard. Conceptually, its the same way I did things with cheatsheets in college before an exam - it just works. I made a legend for things like ⌘⇧⌥⌃⇪, these are very unfamiliar to me as a windows user.
It makes for a frictionless experience for memorizing commands.
I learned to touchtype from playing too much starcraft growing up. If you didn't touch type you were never going to be good, period.
Consequently, playing FPS so much growing up has given me extremely precise mouse movements. I rarely ever misclick things on accident, those quickscopes came in handy.
Gonna have to disagree here, there are good tools and bad tools. This mindset of a tool is a tool is why my company still uses cmsynergy and why nobody writes code is MS word.
Being thought of because you have proficiency in a tool is definitely not a bad thing, especially if it allows you to be more productive. Investment in a tool like emacs also typically isn't a bad thing because emacs can be found on just about any Linux PC in existence, same with vim.
A lot of people use keybindings all the time, even on vscode/atom(at the very least copy/paste). People using vim/emacs don't start by memorising all keybindings, they start with very basics and as they find more useful things, they start using them.
> I think people honestly get too invested in their tools.
Editor is the most important tool for a programmer, so yes you should invest in it(may it be vscode/vim/emacs).
Editor is the most important tool, I agree with you. I still use VIM when working with servers, but that's about it.
I mostly do frontend development so I don't see a huge amount of value investing in emacs. My perspectives might change down the road, when I start working on backend infrastructure.
I still think emacs has too high of a learning curve for the value you get out of it. Installing emacs on windows is not entirely straightforward either, I have to go watch a video to even install it. I write my own scripts and macros on windows all the time though.
The reason why I prefer GUI interfaces is because I can only deal with so much cognitive overhead. I still initialize most things using a CLI (e.g. cloning a git repo). However I don't only do programming, I also do UX, graphics design, and 3D CAD modelling among other things.
Emacs should have enough value to warrant the amount of cognitive overhead it cost. It does if you only program though.
VIM on linux can do some absolutely amazing things with just a keyboard and a single monitor. More so than any other application I've seen. You don't need the touchpad at all. Swapping from insert mode, normal, visual, select etc.
VIM has much stronger capabilities when it comes to editing code / text. It takes very few keystrokes to do common types of text manipulation. With my macbook I always misclick things fairly frequently because I'm not used to a touchpad.
Emacs I don't know any hardcore powerusers, but from what I've seen its similar except its more reactive to inputs
Even though I don't intend on using Emacs or Vim to that level, I still think its worth learning. There's many ideas from these toolsets to implement into your own workflow.
Fortunately this summer I came to realize that VSCode, at least for non-Javascript/Typescript languages, is laughable compared to the Jetbrains IDEs for Python, C++, Java, etc. Even ignoring all of the extra "features", the Jetbrains IDEs are just so much more intelligent at linting, code completion, and symbol lookup. Vim support is much better too.
I do wonder how WebStorm compares to VSCode; I suspect it may not support as many hip frameworks but would still excel in the aforementioned categories.
Meanwhile, I can't overstate how much I hate JavaScript, nodejs, npm, etc. Burning rage of a billion super novas. Bight on humanity. Crimes against reason.
And yet. I'm switching to VS Code. I really wanted to hate it.
I'm all-in for VS Code. Because Language Server Protocol enables a noob like me to create my own language plugin. Plus, with their docs and videos, the onboarding was trivial. I'm still delighted by this experience.
Further, judging from their respective "marketplaces", VS Code clearly has the mindshare and momentum advantage. It's an embarrassment of riches for such a young platform.
Having tried and failed to create and maintain plugins for both Eclipse and IntelliJ, this really feels like a sea change.
That being said, the C# support in VSCode is absolutely amazing. Better than the Visual Studio IDE, imo.
What does it do that is better than VS out of curiosity?
git: GitLens
nuget: Dotnet core commands
both of those plugins are great, and the Dotnet core commands plugin also allows for executing a lot of the .NET core CLI commands from within the editor without having to open a command prompt.
Editor support is fantastic in VS Code, and Intellisense works flawlessly. Not to mention, I don't need to install 25GB worth of junk to get my editor up and running, which was VERY important on my ultra-portable which only has a 64GB SSD. RAM/CPU usage is much better as well.
I do my Emacs-Lisp hacking offline, which is possible because the emacs-lisp reference manual and other useful resources (e.g., the entirety of emacswiki.org as a directory of MediaWiki markup files) can be downloaded with a single command line. In contrast it is too hard to find and render locally usable collections of vscode, typescript, Electron or JavaScript documentation larger than individual web pages.
There are many aspects of my life that require me to be on the web, but I HATE THE WEB and would put up with a lot to avoid making yet another regular activity of mine dependent on my being connected to the web.
There is no net connection in my apartment these days (though there is in some of the common rooms in my apartment building) and I do all my emacs hacking in my apartment.
I long ago got used to making a constant series of small modifications to my emacs environment. Although I might choose to refrain from getting into the habit of doing that if I could live my life over again, it wouldnt make sense for me to unlearn that habit at this late stage of my life, which explains why i would regularly need access to documentation on how vscode is implemented if I were to replace emacs with vscode.
I used to like the web, in the 1990s and later, but it has slowly changed into something I hate. HTML 5 for example severely diminished my experience of the web.
It's amazing how much muscle memory plays a role in tool adoption. The author says "The mismatch between keybindings in VSCode and rest of my tools just kept tying my fingers in knots"
You can't spend years and years doing something one way unconsciously and switch without it being quite painful. I think once you're a Emacs user for a decade or more, you're probably an Emacs user for life -- or at least it's going to be painful to switch.
"It is important to note that the Project Manager addon may have improved significantly since I last used it a few months ago"
Yes. VsCode is a rapidly-changing environment. When I started with it this week, I had downloaded the most popular plugins just for kicks. As it turns out, there were plugins for most every common thing I do. The switch, however, was painful.
Looking at my desktop, I've got a dozen editors, half-a-dozen or more IDEs. This is getting crazy. At some point, maybe Emacs is a much better long-term investment. But if you do that, you miss out on seeing what all the cool kids are doing -- and that's important for a lot of other reasons besides programming (Marketing, for instance)
Sidebar: People get really, really attached to their IDEs. Maybe as much or more as their favorite programming language.
"""
(Disclosure: I'm the author of rjsx-mode)
The best setup I've found is to use js2-mode for .js and rjsx-mode for .jsx, which parse the buffer for syntax highlighting, local refactoring (with js2r) and basic linting. For typescript, use typescript-mode. Flow support is quite bad ATM
nvm.el replaces the shell scripts from nvm.
Add a jsconfig.json to your project root and enable tide-mode for completion. This has worked far better than tern-mode, which some people recommend.
For fuller linting than what js2/rjsx offer, use flycheck. Eslint support is built-in, so it should just work, I think.
[2018 update: I prefer using tslint, which you can accomplish with:
(flycheck-add-mode 'typescript-tslint 'js2-mode)
(flycheck-add-mode 'typescript-tslint 'rjsx-mode)]
Finally, for build management, I use prodigy to run webpack, babel, ts, etc.
Feel free to ping me if you need more help
"""
One thing I didn't mention then was using mocha.el for mocha/jest, along with indium for debugging. I couldn't get realgud set up properly, but had no issues with indium, including for typescript/babel code.
If you have any special config for indium, I would love to see that too.
```
(prodigy-define-service
:name "webpack"
:cwd "~/project/"
:init-async (lambda (done) (nvm-use-for "~/project/" done))
:command "npm"
:args '("run" "build" "--" "--watch")
:ready-message "Build Finished")
(prodigy-define-service :name "tsc"
:cwd "~/project/"
:init-async (lambda (done) (nvm-use-for "~/project/" done))
:command "npm"
:args '("run" "compile" "--watch")
:ready-message "Watching for file changes.")
(prodigy-define-service :name "server"
:env '(("PORT" "6789")
;; etc.
)
:cwd "~/project/"
:init-async (lambda (done) (nvm-use-for "~/project/" done))
:command "npm"
:args '("run" "serve-dev")
:ready-message "Listening on 6789")
```It is at best ambiguous in your comment whether this is intentional or not but the article is about VSCode (the text editor), not VS (the IDE).
To me, vim, neovim, spacemacs, emacs - all require a bit too much configuration for my taste. I just want things to work, without having to spend a lot of time micromanaging them. I tried Atom, but always found it to be super laggy. SublimeText is really nice and fast, but it seemed like some of the support packages were behind the times - and I could never get vim emulation to work the way I thought it should.
I have found that VS Code really hits the sweet spot with performance, package management, and vim emulation. Packages are well supported and super easy to manage, and the vim emulation does all I need from it without any noticable lag. I rarely need to change any configuration more than a line or a few at most.
Like others have mentioned here, I still do everything with git from the command line - except maybe the occasional diff perusal in gitlens.
I prefer my SCM integration outside of my editor or IDE as well. I don't need my IDE to get in the way and spend CPU cycles telling me what files I have changed. I complete something then pop over to git CLI or maybe a tool like SourceTree/Tower etc and check in that feature. I like it as a separate process, when I am in my IDE or editor I am focused on code and then when I am in my git CLI/client I can focus on repos.
In my opinion, SCM integration and plugins/extensions into IDEs/editors are mostly annoying and sometimes can lock up or lag editors like Visual Studio and especially MonoDevelop. I do lots of Unity and MonoDevelop's SCM integrations were always heavy and slow. Git/Mercurial/other SCM/repos plugins are usually the first thing I turn off in an editor.
So now I use Intellij for anything Java, VSCode for all other coding and Vim for quick edit tasks. The Vim keybindings keep every editor feeling familiar, but I have the editor benefits where needed (I couldn't imagine writing Java in anything but Intellij for example).
[0] https://code.visualstudio.com/docs/editor/versioncontrol#_vs...
i really want to like emacs, i think it's probably the most productive environment if you sink a thousand hours into fiddling with your configs and get things just right for yourself but ultimately it's a breath of fresh air when most stuff just works out of the box and your config is just bunch of checkboxes and simple text fields (or json). i've tried spacemacs and i've tried writing my own config - none of it is even close to how quickly you can get comfortable and productive in atom/vscode, even if the productivity ceiling is (maybe) lower than that of emacs.
i'm in constant cognitive dissonance about electron apps. atom and vscode are just incredibly good projects.
the initial task of setting emacs up seems to be one of the most common complaints, but I don't feel I really went through that with spacemacs. other than adding a layer now and then, I think I've made less than 20 minutes of changes to my config total, most of which was looking into a bit of lisp.
perhaps I should've tried a vim plugin for other ides, but I can't see myself switching to something like vscode or a jetbrains ide despite agreeing that they're good.
I do have a few extra things turned on, e.g. global-subword-mode so that I can traverse CamelCase as if it consisted of two words, and a few packages specific to the languages I'm programming in. But that's really secondary.
My initial reason for switching from Notepad++ to VSCode was file search speed. We have a lot of 5GB folders at work that I can search in a few seconds in VSCode. It needs 2-3 minutes in Notepad++. That is of course thanks to ripgrep.
Even opening file/projects is a bit weird to me.
VSCode isn't necessarily to blame for this, it's just different from TextMate and Vim. Still I've found it rather difficult to get started with.
For what it's worth I feel like the best way is to just explore the settings and see what's there. Ctrl-, to open settings, then you should see the default settings on the left side. Most plugin authors are pretty good about putting decent comments to explain their configurations, and the auto-complete should help to evaluate any options available.
> Even opening file/projects is a bit weird to me.
I've been using it 2 years now and still find the Ctrl-K Ctrl-O command to open folders awkward and nearly impossible to remember.
cd path/to/folder && code .
Pretty easy to remember tbhI used emacs for writing JS for years, and for the time js2-mode was amazing, but the JS I'm writing now is quite a bit different. JSX and Vue templates complicate the situation as well.
Since VSCode is written in JS, I suspect that it will always have advantages when writing JS in the same way that emacs will probably always have an advantage when writing Lisp.
Since ditching Emacs, I’ve been using Atom, VSCode and Micro, but Emacs is superior IMHO. But multicursor support is really cool in these new editors! I’m using it all the time :)
https://en.wikipedia.org/wiki/Sticky_keys
I use it for many years with Emacs and I have no pain in my hands.
(i also wish lsp-mode would improve.)
You don't have to do that if you setup a jsconfig.json file in the root of your project. https://code.visualstudio.com/docs/languages/jsconfig
I bet Steve himself is coding on something like Intellij/VSCode, dropping to Emacs only when the craziest text replacement job is required.
I do find however that it is something that skilled programmers will likely outgrow except perhaps a subset of them. I myself moved on to the JetBrains family of IDEs and use vim for minor edits or doing edits on the command line.
I’m not sure how Atom lost out so badly in this they used to be pretty good but I hardly hear about them anymore
edit: given that my response was a little vague, i'll elaborate.
Visual Studio Code is wonderful for getting your feet wet in programming. New Programmers i've worked (interns, usually) have tended to have professors that teach Java and use NetBeans (i mean whatever, fine). So often thats what they've used as their tool, and usually not a tool that they enjoy all that much (in my experience).
Usually I have them start up with VS Code and the feedback I always get is that they feel more productive, especially after adding a few plugins. I think VS Code is just more intuitive to get the hang of and for the most part has a power plugin ecosystem that can take one far enough not to feel like they're completely out of the loop.
Where Visual Studio Code and the like start to break down for me (Vim has this problem too, and heck, I have found very few other IDEs that can even handle this properly) is when you get into multi-language projects where you have code that is interdependent on some level.
For instance, with Python, I can get Jinja syntax highlighting in just about any editor, but I have yet to find another editor that so perfectly will autocomplete my variables from my Python code into the template and vice versa. Even better, as of recently, I have noted that not only do they complete my variables, but my @context functions are showing up as well, as well as my filters. JetBrains is worth every. damn. penny. This is such less mental overhead to worry about (especially because, if anyone who has read my posts here will note, I'm prone to typos)
Once you get to a point where you are consistently living in more complex projects and have multiparadigm code you're writing, I haven't found any tool that handles it this way.
I just can't get over how good JetBrains is at making their product suite. I recommend them at every turn. I do not however think, just because there are so many features (and a great plugin ecosystem that it has) recommend it to outright beginners, there is a bit of a ramp that will get in the way of learning I have found if you start people off on it right away (Even with the awesome free versions like PyCharm EDU or Intellj EDU, they're just too overwhelming for newer programmers I have found). With that said, everyone I have worked with who has interned with us has ended up on a JetBrains IDE if they come work for us and I haven't had any real complaints yet.
Disclaimer: I don't work for, nor do I receive any compensation from JetBrains. I just think they're a damn good product and deserve to be recognized.
One thing that keeps me in VSCode is the support it has for the "non-mainstream" languages since it exposes the Language Server Protocol. I use VSCode for writing Elixir and Rust since there is pretty good support for both languages.
Its really good. I do a good amount of Rust nowadays, I've had no complaints.
Also, has wonderful Elixir support IMO. There's a really cool elixir plugin. I admit I've only toyed with elixir and not used it in production, so I dunno exactly how good. Maybe I over sold it in the first sentence, but I thought it worked really well.
I've used it extensively with Lua via a Plugin. Its really good!
there is also a specific language server protocol plugin too for any JetBrains IDE: https://plugins.jetbrains.com/plugin/10209-lsp-support
Can't say that every use case is covered, but I have yet to find one that isn't! :)
Thanks for pointing this out though as it shows others that there are other options.
No stellar team at Microsoft supporting the project?
I feel like there might be an interesting story there, maybe. Or maybe not. Not sure.
If you are on windows, use VSCode for the light stuff (though I prefer other editors ) and Visual Studio for serious coding. I know Visual Studio is "heavy", but if you are going to do windows programming, you should have the hardware to support their IDE.
All this evangelism by VSCode and the other side really doesn't contribute much. The key is to stick to a tool and develop some expertise.