Emacs vs. WebStorm for Node.js Development
spin.atomicobject.com
spin.atomicobject.com
This is due among other things due to their upgrade to Java 8.
This is the link to the early access program https://confluence.jetbrains.com/display/WI/WebStorm+EAP
The other thing that drive me a bit nuts is the multiple versions. Webstorm vs Rubymine. I build on Rails, but do most of my UI work with Angular+JS+Webpack. So which should I use Rubymine or Webstorm?
It's all too confusing.
If you compare this level of support for Vim with MonoDevelop, you'd realize just how good it actually is.
IntelliJ Ultimate and install the plugins for both of those.
I have "ctrl-(hjkl)" mapped using https://github.com/christoomey/vim-tmux-navigator so I have an extremely easy time navigating between splits in terminal vim. I tried like hell to get "ctrl-(hjkl)" to work in IntelliJ. I eventually gave up and decided to just start clicking the panes like a caveman. It never even crossed my mind to try the original bindings.
Thank you.
Actually, tern has tern-find-definition which works not only in a single file. You can jump in to other modules in your project or to node_modules. And there is tern-pop-find-definition to return back. For methods of native js objects tern even opens browser with related MDN page. But WebStorm way better in debugging, that's true.
I haven't been able to make this work outside my current file. Perhaps I'm just configuring tern wrong :(
{
"libs": [
"browser"
],
"plugins": {
"node": {},
"es_modules": {}
}
}
Your project files must have "correct" format, e.g. require('relative_path') for imports and module.exports/exports for exports (or es6 import and export). Example for AMD format (requireJS) can be found here - http://ternjs.net/doc/manual.html#configurationMy gripe with VisualStudio code file tree is that it doesn't have icons - this is actually pretty huge for me - I use the file tree when I'm reorganizing code structure and need a good overview of things - for all it's failings as a text editor Atom file tree is really nice with the icons addon - hopefully something like that shows up for VSCode.
That and YouCompleteMe for C++ and I'd switch all the way to VSCode, and I have no doubt that is going to happen so I'm just waiting now (too little time to work on it ATM otherwise I would start it)
I don't fully understand the rationale behind shying away from tabs, but reducing cognitive load/context switching and reducing CPU/RAM strain seems to be the desired effect.
My only pain point with VS Code right now is the lack of any kind of core REPL support. I'd love to be able to sling stuff back and forth between source code and a REPL like you can in emacs. And yeah I know about Command-C - I just want to do everything in the IDE.
As a side note, WebStorm also supports TypeScript definitions. It has an menu to download and add them to your project from definitely typed under "Preferences->Languages & Frameworks->JavaScript>Libraries"
To make me switch to this 'working files' area really puts me off their product.
See JavaScript > Libraries > Download... and make sure to choose TypeScript community stubs. You can also add your own manually.
>While Emacs can find symbols and definitions in a single file via Tern
Tern supports node.js module loading so this should work across modules.
Does WebStorm have it's own proprietary debugger?
This hasn't been my experience. I've tried various term commands and configuring tern to do things like eagerly loading project files, but it still only works for me in a single file. Do you have any links to docs on how to do this?
{ "ecmaVersion": 6, "libs": [], "loadEagerly": [ "node_modules/lodash" ] }
I'm definitely getting lodash method lookups and they work well.
I hear it's not a good idea to throw all of node_modules at tern -- but the same applies for WebStorm.
My whole dotemacs (including skeleton) is here https://github.com/wcummings/dotemacs
When I develop Scheme with Geiser, it knows which module I'm working in currently and it knows how to jump to the definition of any symbol by inspecting the source information attached to any Scheme object. I can quickly jump to the REPL or evaluate arbitrary expressions. No ctags/etags or other static analysis tools, just a REPL. It's a really productive way to write and debug code.
In addition to the other stuff I mentioned, Geiser also gives me symbol autocompletion, automatically shows me the printed representation of the value under the point, shows me the signature for the current procedure I'm working with, and shows docstrings if I press a special key combo. Maybe I didn't make this clear in my previous post, but Geiser does all of these things in the source buffers themselves, not just in the REPL buffer. If there's anything resembling this for Ruby or JavaScript I would love to know about because those are the two languages I am paid to work with.
The basic idea is to extract the string inside the require or import call, then ask a node subprocess to locate that file (using require.resolve), and use emacs to open that file.
I'm sure someone more experienced with elisp can take it to the next level.
See the interactive commands section towards the end of the file.
https://github.com/ustun/emacs-helpers-for-js/blob/master/uo...
edit: And there's nothing wrong with key bindings being 30 years old, Vim for instance has an incredibly efficient interface. Also, I find knowing basic emacs bindings quite useful around the OS X interface (many of them work).
(I know some people like to shake themselves up by doing the text editor equivalent of putting their shoes on the wrong feet, then once they get used to that, switching to walking on their hands to stop themselves from getting too comfortable - but I'm not one of them.)
IDEs come and go. Emacs stays. It used to be mocked to be too large, today it's an average package, and tiny compared to other IDEs. It does a lot and let you extend it very freely (as of 2008, doing anything in Eclipse was a burden, can't speak of todays state though, I'll add that Emacs cruft has nothing to be ashamed of to the Eclipse Plugin and Workspace model, hundreds of (Object) list.get(arbitrary-index), TIMTOWDI.. )
People drool over features that were present in emacs for decades (flex match), and I've seen emacs absorb new ones (in-place evaluation of code with value preview for instance) faster than I would hope (a few years ago, a 2h sublime demo had literally nothing special).
It's syntax system felt (I never looked into it) superior to Eclipse (except for JDT) and VS.
Also Emacs users have a way of doing things. No mouse, often very lean. I'll rant about Eclipse again, but it really is bad. My hands hurts after one day (I morphed into an emacs alien maybe). Git integration is between unusable and useless (after 10y+ of work). etc etc
Plus energy is still flowing, look at Spacemacs, it's a lot less absurd than emacs, with a more stable plugin mechanism. People are still working on bringing guile elisp mode as the base vm.
Emacs have a lot of issues, and they don't matter.
https://www.dropbox.com/s/e6vhweatnrb98ow/spacemacs.png?dl=0
Are you _sure_ it is something usable? :)
On my MBP and the ones of my colleagues, plus my windows machines, spacemacs works great and without issues the last couple of months.
It even convinced 10y+ vim and IDE users to jump ship after testing it for a week.
From my own experience: developing in go, elixir, javascript + react ... It feels exceptionally great with the correct "layers" installed. And being a top notch crosslanguage IDE is just the tip of the iceberg of what spacemacs/emacs actually is capable of...
Just wanted to remind everyone not to forget to donate when you find a tool that really saves you time/brings you joy while you dev.
Magit takes donations @ http://magit.vc/donations.html
I'm not at all affiliated with magit -- just donated and thought other people might feel the same if reminded.
(Nice article too :)
not being able to Ctrl-click a variable or function really reduces my efficency (especially with code that I did not write entirely on my own).
Webstorm does a great job here. But unfortunately like any "intelligent" tool, when there is a bug in the system you end up with a very frustrating tool. Right now there is a bug that causes properties defined on objects to be available in the global scope. I filed this bug some time ago, wish it would get some attention:
https://www.cluelet.com/user/cluelet/emacs-vs-webstorm-for-n...
Disclaimer : Wrote the above app for comparisons like these.
I do love jetbrains products so I will probably try again with Webstorm at some point, but for now emacs will do. I use emacs for org-mode project planning as well as for its scriptable editing
I started my career writing Perl CGI's, and have used, at various times, PHP, Python, Tcl, Ruby, Erlang, Java, Javascript and of course a lot of other stuff. Emacs has always done a good job, even if perhaps there was some editor/IDE that was a bit better for that specific langauge.
Lives up to that, IMO. I switched to WebStorm a couple months ago after using a combination of vim/Sublime and would never go back.
I do have the same issues the author has re: the Vim plugin though, could be much better.
> "complex edits [in Emacs] using Vim macros"
This is a big surprise. I left vi for emacs in the early '90s when vi's macros were crippled, to say the least. I'm using vim for quick edits, mainly on servers or configuration files (sudo vi /etc/something). Did vim macros really become better than Emacs' ones?
Emacs isn't that much worse, vim is just faster and easier.
;; select the current graph
(execute-kbd-macro (kbd "ma{y}`a"))For editing multiple files (mostly code) or a project folder, I use emacs with X11.
:maappend chars to end of line( * )Jf:D
Then ^N to execute it, I think.
( * ) I don't remember how we quoted ESC
When I saw that emacs could record macros while I was typing that immediately sold me the editor. Multibuffer and multifile were nice features too.
At this point, I can't take the review seriously.
It has everything WebStorm does plus better "dumb autocomplete" like Emacs and it's free.