Atom editor setup for Clojure(Script) development in 2020

If you wonder how to set up Atom for Clojure(Script) development, this is the place for you! I couldn’t find any guide online so I asked more experienced people and here you go.

You need just a few packages:

  • REPL: Chlorine - Sean Corfield wrote an inspiring post about why he switched to Atom+Chlorine. You just need to start a socket REPL in your project (see the plugin page for instructions) and connect to it. You get autocompletion, inline results in the editor, and much more.
  • Structural editing: Parinfer + Paredit - you can never truly appreciate a Lisp unless you leverage structural editing. Parinfer gives you an intuitive, simple model for working with parentheses (indent code block => include it in the previous form at lesser indent, delete ) to move it furthest right, …). Paredit provides useful hot keys to operate on expressions such as “wrap the following expression in (…)” or “delete until the end of the current expression”.
  • (Optional) linting with kondo - a good, evolving linter with warnings about bad practices

You might also want to have a look at seancorfield/atom-chlorine-setup with useful commands, key mappings, and extra support for REBL.

I’m a die hard Emacs fan (been using it for close to 20 years now) and I can’t see myself switching, really, but I was intrigued by your post, and gave Atom+Chlorine a spin. It was nice, easy to setup, and looks fairly impressive (if a bit lacking in functionality compared to Cider). I would definitely recommend something like this to someone new to Clojure and with no Emacs background!

2 Likes

@mvarela great to know! Chlorine is still evolving, and I’m working together with other tooling authors to make it better (and this includes integrating some Cider functionality too).

Can I ask what you did miss? So it would be easy to prioritize features on the package :slight_smile:

1 Like

@mauricioszabo, first, thanks for your work on this (even as a likely non-user), it’s great!

Regarding what I missed, I only took it for a quick spin, and didn’t really go into the docs, so I can’t give you much insight, but the things I noticed:

  • Lack of jack-in functionality, so I need to go to a terminal to start a REPL
  • Functionality like the one provided by cider-eval-pprint-last-sexp. I use that all the time. Printing eval results is ok, but when dealing with larger maps and such, pretty printing becomes more important. Cider does that in a separate buffer, so it doesn’t clutter the code buffer (again, this is more important for larger data)
  • Debugger

I’ll try and give it another, deeper go, and see what pain points I notice (though I suspect those will be more related to missing my Emacs config/functionality, rather than Chlorine)

1 Like

a superior alternative to pretty printing, especially for large data, is IMHO the commercial but very cheap Cognitect REBL

@HolyJak, I don’t doubt REBL it’s great. I’ve never used it myself (yet), and I’ve been using Cider’s pretty printing for years, so it’s more of a habit thing. Based on Stu’s presentation, and Sean’s screencast, it does look like an amazing tool, though some people might balk at it not being free (both as in beer, and speech).

Word.

I also like that you highlight that Parinfer and Paredit aren’t mutually exclusive, like so many people seem to think they are.

I’m an emacs user, but I tried chlorine a bit, it is great. The thing I miss is a keyboard shortcut driven, full-featured data inspector.

1 Like

:+1: I wonder if this was best addressed by an editor-independent tool that could multiple editors leverage. Some nrepl Middleware, REBL, or an open-source alternative…

What about [data walk] (https://github.com/eggsyntax/datawalk)?

I’d love something like that in Cursive. Constantly manually set! -ing print-length/level, manually pretty-printing is a brake on my dev flow.

Can you elaborate a little bit? You mean, to inspect the data with only keyboard shortcuts instead of using the mouse?

If so, I too miss it :laughing:. If you have any idea on how to implement something like this, I can try to implement something

@mauricioszabo, yes, pretty much that: https://docs.cider.mx/cider/0.23/debugging/misc.html#_inspecting_values

I hadn’t heard about datawalk until I saw @HolyJak mention it, but I gave it a go today, and it seems pretty cool (though it’s a bit tricky to make it play nice with Emacs, at least with my config).

Hi, I think that should be something like a rebl, with some keyboard shortcuts support, have a dedicated window.