14

I've used vim for a pretty long time and I'm still happy with it. I started to learn clojure 6 months ago. It seems that emacs is the first choice for lispy language programming. But I would rather learn something else than spend a lot time on learning how to use an editor which is not obviously superior to vim.

So I struggled to make my vim setup more suitable for clojure programming.

What I'm now using is:

  • vim-clojure-static, which provides basic syntax highlighting
  • paredit, which provides structural edit on s-expression
  • vim-fireplace, which can talk to a remote repl within vim

I also use vim-redl, redl to get a debug repl, but IMO the three above can already provide quite pleasant coding experience.

My question is, am I still missing some killer features of the emacs working flow?

Wei Qiu
  • 886
  • 9
  • 16
  • *some killer features* Obviously, you can't extend vim with lisp, while writing lisp. You have to resort to alienated [VimL](https://en.wikipedia.org/wiki/Vim_script). – om-nom-nom Jun 06 '13 at 14:31
  • 6
    Try emacs with [Evil mode](http://www.emacswiki.org/emacs/Evil). It is a VIM emulation layer which is pretty good according to ex-VIMers, so you can use Emacs like VIM while having access to features which emacs provides. – Tom Jun 06 '13 at 14:50
  • Voting to close. Not constructive. See: - http://stackoverflow.com/questions/48006/is-it-worth-investing-time-in-learning-to-use-emacs - http://stackoverflow.com/questions/485120/will-emacs-make-me-a-better-programmer?lq=1 - http://stackoverflow.com/questions/551289/should-i-learn-to-use-emacs?lq=1 – noahlz Jun 06 '13 at 21:05
  • See also [Using Vim for Lisp development](http://stackoverflow.com/q/94792). – glts Jun 06 '13 at 21:35

3 Answers3

15

Is emacs better for clojure/lisp development? Yes, it is. Can you do without it, of course. I used vim for Clojure development but I switched to emacs a couple of months ago and I'm very glad I did. Personally I find it a much better experience. The vim plugins probably have matured a bit in the meantime but vim has some serious limitations with regard to external processes and so on. I had some general vim plugins I really loved but luckily they all had alternatives for emacs.

Couple of things worth mentioning:

  • I use Evil mode. Like Tom mentioned it's a vim emulation layer. It's extremely good. I don't miss anything from vim. Text objects, all the vim modes etc are supported. Personally I can't remember all the strange emacs keybindings, they drive me nuts. Without Evil I wouldn't be using emacs. I created evil keybindings for paredit and some other plugins and you basically have vim on steroids. I only use vim for quick edits now.

  • Customizing Emacs was the hard part. I love Emacs now but I wouldn't know what to do without my customized Emacs config. Once you tweak everything to your liking it's very hard to go back to anything else. It took me a long time to get to that point though. Check https://github.com/otijhuis/emacs for my personal emacs config if you want to try it. It still needs a little work and I'm no Emacs guru but it works really well for Clojure development. It might be a good starting point.

Okke Tijhuis
  • 306
  • 1
  • 3
5

I'd like to point to the upcoming vim-sexp, by the maintainer of vim-clojure-static:

vim-sexp

Precision Editing for Symbolic Expressions

This plugin provides mappings, operators, and text objects for Lisps including Clojure.

I don't use Clojure myself, so I can't tell for sure, but the plugin looks very promising and is under active development.

glts
  • 21,808
  • 12
  • 73
  • 94
2

The reason Lispers tend to like Emacs is that Emacs is a lisp machine. If you're already familiar with the language family and its tendencies, it's really convenient to be able to use it for extending your editor.

From my own (admittedly Common Lisp, rather than Clojure) workflow, I like having autocomplete, argument hints, and the SLIME macroexpander. I'm pretty sure you can get each of these for vim, so don't stress too much about what everyone else is using.

As a note, if you haven't already, look into slimv and this article on setting it up with Clojure. I haven't used it myself, not being a vim user, but it seems close enough.

Inaimathi
  • 13,853
  • 9
  • 49
  • 93
  • I got quite confused by so many tools available. However, slimv+swank-clojure seems to be abandoned, according to this https://github.com/technomancy/swank-clojure. I'm asking this question because I'm relatively new to lispy languages. I just found how powerful the repl tool chain is. Before I came to vim-fireplace, I was using slimux and was already quite satisfied with it, but vim-fileplace brings the whole developing experience to another level. So I was worrying that I haven't make use of all its potential. – Wei Qiu Jun 06 '13 at 20:00