Battle of the Elixir code editors

If you’re anything like me then you’ve yet to come across a ‘perfect’ code editor. Some of them get really close but then their idiosyncrasies become more and more bothersome over time.

Maybe we can use this thread to highlight what you feel each code editor gets right… as well as wrong (maybe that feedback will lead to updates or fixes!).

See this thread for who’s using what.

1 Like

Here’s my view so far (I’ve probably missed stuff so might edit later!):

textmate 2

####What it gets right

  • Still the best looking editor Imo - the font, the letter spacing the line height the padding and the overall design. Nothing has quite matched it in the looks department so far:

https://elixirforum.com/uploads/default/original/1X/ac9701fc23e9cf71f698a62e2e10ced0df45cbcd.png

  • I also like how you can use the standard Mac shortcuts for things, like CMD and the right arrow key to jump to end of line, left to jump to start, up to top down to bottom. CMD and ] to indent line or selection, etc It just feels right when using it on a Mac.
  • Fairly decent Elixir support

####What it gets wrong

  • No split windows (they said it was coming, but never did!)
  • No auto-complete (or rather, auto-complete-as-you-type)
  • No terminal windows

#MacVim

####What it gets right

  • Quite a lot, and it’s definitely the second best looking (on a Mac anyway).
  • You can also use many of the common short cuts as per TextMate (for indenting etc).
  • Split windows - I love these
  • Modes - though I could live without these if I had to
  • Excellent Elixir support with Alchemist plug-in (tho see below)

####What it gets wrong

  • Can be complicated for nubes
  • I couldn’t get ‘YouCompleteMe’ (the auto-complete-as-you-type plugin) to work :frowning:
  • Good, but still not as good as TextMate looks wise

spacemacs

####What it gets right

  • Again quite a lot, and just behind MacVim on the looks department
  • Excellent Elixir support with Alchemist plugin
  • The learn as you go approach with the spacebar
  • Good terminal support

####What it gets wrong

  • Can’t use Mac (CMD) shortcuts for indenting, jumping to end of line etc, even with the Mac version of Emacs (as far as I know anyway)
  • Can’t use ALT + 3 for the hash key (instead have to map and use the right hand side ALT key with 3)
  • Can’t TAB after def, name , args to jump to next line (like you can with MacVim+Alchemist

#Others I tried but didn’t really like

Atom, Sublime Text, Visual Studio Code

#Others I want to try

Plain ol Emacs :003: (and maybe IntelliJ)

2 Likes

I played with Spacemacs, Atom and Sublime. Of the three I prefer Sublime the most.

Spacemacs

The like

  • Has support for almost anything. Especially Alchemist is great tool
  • Not much ceremony on splitting/moving windows around
  • Love running terminal inside the same frame with code
  • Vim like editing

The don’t like

  • Vim like editing. Yes this is also it’s strength but I found my self many times thinking
    how to edit the code than the code itself. This is really distracting. I have read plenty of books and articles about Vim editing and I really like it, but still it is another overhead for my brain.
  • Poor mouse support. Many people prefer the keyboard and I really tried to like it. Unfortunately playing with Dired or Neotree was distracting me from flowing with my code.
  • Everything has to be done with keyboard shorcuts. The are indeed well documented and discoverable but they are so many that some times I have to pause and remember.

Atom

The like

  • Great Elixir support.
  • There is a package for almost everything
  • Easy to customize
  • PlatformIO IDE Terminal emulates a terminal in the bottom of the editor. Can be hidden and shown.

The don’t like

  • Feels slugish
  • Can’t make fonts look good
  • Needs a lot of ram

Sublime Text

The like

  • Fast
  • Light
  • Editing text flows almost as fast as I can type
  • Pretty out of the box

The don’t like

  • Elixir support is not as good as in Spacemac and Atom. There is elixir-tmbundle that provides syntax highlighting and code formating and SuperElixir which looks very promising.
  • No simple terminal emulator at the bottom of the editor. It can be done with Origami and TerminalView package but it does take a bit of work every time to set up. And there is no simple way to hide and show on demand.

Right now I prefer Sublime. Speed of editing is what really keeps me there. I overcame the terminal at the bottom thing by using the i3 window manager and changing layouts on demand.

1 Like

While I can appreciate that these points are important to you personally - I’d like to shift perspective a bit.

  • I switched to Emacs because after a few months of Vim the constant switching between “command” and “insert” mode was still getting on my nerves. So I use spacemacs in “emacs mode”. I like Spacemacs because of the configuration layers.
  • Mouse support is a double-edge sword. While it’s certainly convenient - how are you going to learn (and remember) the keyboard shortcuts if you don’t use them? For me personally part of the motivation to switch to Vim/Emacs was to use an editor that works perfectly in a text-only environment often found when dealing with “remote environments/hardware” (while still providing language specific support) in an increasingly “cloud-oriented” infrastructure - without having to FTP files back and forth whenever I needed to change something. Vim/Emacs have been around for a long time and it doesn’t look like they are going away anytime soon. If I had continually used/invested in Vim/Emacs since I started programming I should/could be a Vim/Emacs genius by now - instead of wasting my time with a generic editor with mouse support or learning yet another IDE GUI interface. Becoming familiar with the keyboard shortcuts is a slow and possibly painful process that only pays off in the long run.

Sometimes it is worth to learn something that is initially difficult if it pays off in the long run. Always going the easy-to-learn or easy-to-use route often leads to “too constrained to be useful” or “so short-lived (and now unsupported) that I now have to learn something new (again and again)”.

2 Likes

For the last 5-6 months I was using exclusively Spacemacs. I did learn a lot of it’s features and I am way more comfortable with editing a buffer in Vim than before. A couple of weeks now I tried again Atom and then sublime. I felt a strange feeling on relieve with them and not really missing any features (well… except for the “A” and “.” keys).

1 Like

I don’t doubt that for one second. But in 12 months when you find yourself in that situation where text-only Vim is the best you have, will you remember the keyboard shortcuts? The easiest way to ensure that you will, is to constantly use Vim keyboard shortcuts. Typically I would not advocate optimizing for what seems like the 1% use case - but programming seems to be becoming more and more ployglot-oriented and often spanning diverse operating/working environments where it would be nice to at least have somewhat universal editing skills.

From that point of view my choice of “Emacs” is a bit foolish because it’s much more likely that an environment will support Vim - but at least I’m now on an editor where I can give Vim another chance (I started with Vim because it’s often portrayed as being easier than Emacs - frankly I don’t know where that reputation is coming from - I personally wouldn’t consider Vim easier than Emacs; sure they’re different).

1 Like

Atom

####Right:

  • Well supported with plugins and themes
  • Can provide something very IDE-like
  • Doesn’t take additional brain-power to use (keyboard shortcuts)

####Wrong:

  • Memory hog
  • Splits are really unintuitive having used tmux/vim/spacemacs/etc

Neovim

Right:

  • Modal editing, once you’ve used it, you’ll feel crippled anywhere you can’t use it
  • Plugins: can find (or make) a plugin for almost anything
  • Non-blocking actions with Neovim
  • All the other Vim goodness…
  • Fast to start (I’m looking at you Atom & Spacemacs)

Wrong:

  • Plugins: confusing to configure when you’re starting out, or trying something new
  • Buggers up Phoenix’ live reload., due to Neomake. Live reload is more important to my workflow, although Neomake was a revelation when I first added it.
  • Extra brain cycles required whilst you’re learning either Vim or the project at hand. I still find Sublime/Atom easier to hop around and get to know a codebase

I’ve used Spacemacs, Sublime, Webstorm (et all), VS Code. Didn’t really like any of them. Special mention for Coda though - anyone remember how cool that was?

3 Likes

I’ve heard that argument over the years many, many times, and am still waiting for it to happen :wink:

3 Likes

META NODE: A quick comment which turned into many paragraphs. I am getting old :confused:

The easiest way to ensure that you will, is to constantly
use Vim keyboard shortcuts.

I attribute vim keyboard shortcuts for saving me from any carpal tunnel
syndrome or other problems. Before I went full vim on everything (i3wm,
mutt, vimb browser, vim, vi-mode in shell) I had much more problems with
muscles in arm and back, reaching for the mouse all the time instead of
keeping my hands on the home row where they are supposed to be. Nowadays
my body like me better.

Also, I try to rely on tools which hopefully wont change to much. I was
going to say that “This lets me focus on developing rather than adapting
to new tools” but I don’t actually focus on development anyway so it is
not a good point :slight_smile: At least I don’t have to spend energy to change my
tools for no added benefit.

I think everyone wants development to happen in their own particular
field (me included) but that overall most people do not want drastic
change. Looking at the success of Windows XP for example I think most
people still would have preferred to use their old tools. And to be
frank I don’t actually think end user software has actually improved
much in the past 20 years. I think software has become victim to the
markets in that you need to have a new shiny thing to be able to sell
it. The easist thing to change to make something look better is to
change its apperance.

20 years ago I used emacs, gcc, vim, Word, Excel, Netscape or
IE. If you compare them with today not much has actually changed I can
easily do whatever I do today with yesterday tools. The extra hardware
we have today is eaten up by sluggish software. The one thing that has
changed is improved internet speeds and the ability to use “cloud”
storage and the like.

I’ve used the same setup for over 10 years and I hardly have to change a
thing. This let me master my tools. Who cares if learning curve is hard
if you invest over such a long time. The important thing is that you
actually can become a master of the tools. Most things today are
developed for beginners and that is where things stop. The tools wont
allow you to become better, it is all sacrifised to be beginner
friendly.

To tie this back into editors: I use vim :slight_smile:

3 Likes

Why can’t you in Atom? It’s all CSS, I changed mine to use Source Code Pro as the font long ago.

But nowadays I use Atom and Spacemacs/Emacs for the similar reasons as stated prior. ^.^

1 Like

Well, actually after your comment I put atom and sublime side to side and now I almost can’t see a difference. I will scratch that from my list :laughing:. Maybe I need a better monitor :laughing:

2 Likes

Personally, I prefer using Sublime. It is:

  • Fast
  • Light
  • Useful shortcuts
  • Autocomplete is really good
  • Go to method definition
  • Split windows and many other features

I installed a package for elixir support and that is really helping me to become comfortable while coding in elixir.

I tried:
Atom (heavy and fonts looks bad),
VisualCode (Heavy and shortcuts has a learning curve)
Vim (Cool and light but requires a lot of plugins to become fast to use)

1 Like

I think when people say vim is “easier” they are referring to the configuration, for instance I have used vim for 8 years and emacs for 1 year and my vim configuration is about 200 lines less…Although it is more enjoyable to configure emacs, but that is my opinion.

Atom has become fairly lightweight the past year, but still, if you don’t like the font, change it, I use Source Code Pro as my font for example. ^.^

1 Like

The down side of this is that sometimes new tools are better. Otherwise you wouldn’t be here. If a new language can be better, then it’s just as likely a new tool can be better.

Personally, I have found “multi-mode” editing to be a game changer. Now you can do that in Emacs and Vim, but you have to know that is even possible.

Likely everything “90% of the new stuff is crap”, but you have to stay open to the possibility that sometimes it isn’t.

Oh, as to what I use, a lot depends on what I’m doing and how much time I’m reading code vs writing it. I switch between emacs in a terminal, Atom and Sublime Text mostly these days. I’m fluent enough in vi to use it in a pinch although I’ve always despised it’s modes.

1 Like

On my i7 machine it works fast, but in my previous one (i3) I used to spend a few minutes the editor to load for complete. I have tested same font on atom and sublime and seems not the same. anyway that is just my personal opinion. this thread is not about the best editor. i think is just to mention our experience with each editor we have used. sometimes i use vim when my hand is tired to use mouse. :slight_smile:

Fresh installed FreeBSD server. Standard editor: VI. :wink:

But you don’t do serious code editing on the server, do you? And for simple edition you need to know what i does, along with :q and :w And that’s all :slight_smile:

Beside, if anyone is giving you access to fresh instalation of os on server, then probably you are not mere “software developer” but also a “dev ops” guy, and if so, not knowing how to make simple edit of a text file is least of your problems :stuck_out_tongue: