Vi(m) and Lisp

Those of you who have been around for a while know that I was a Vi(m) user for a long time. I switched to Emacs when I started doing most of my programming in Lisp and Scheme. My main reason for the switch was to get Slime. It's inconvenient, although possible, to program Lisp interactively in Vi. Yes, Yes, I know about Paul Graham and doubtless many others but the point stands.

Until I read Dorai Sitaram's post on Editing Lisp and Scheme files in vi, I hadn't realized another problem with programming Lisp in Vi: indentation. When you're programming in C, which I mostly was in those days, the Vi family of editors does a very nice job of autoindenting your code as you enter it. It wasn't as good at reformatting, as I recall, but I don't remember ever being annoyed by it so it was, apparently, good enough. I usually handled natural language reformatting with fmt which, again, wasn't seamless but seemed good enough at the time.

Sadly, there's not a good solution for Lisp/Scheme code1. That's what Sitaram's post is about: external, fmt-like, filters to handle the chore. The seamless formatting of whatever code you happen to be writing is something that Emacs users just take for granted and reading Sitaram's post made me realize that I've been spoiled—or assimilated as the Borg would say—by this. I wouldn't want to be using Vi even if they had a reasonable Slime solution (which, apparently, they do).

As I've written before, I never enlisted in the Vi/Emacs holy wars and even though I'm (now) thoroughly committed to Emacs I still have warm feelings for Vi(m) and maintain a great deal of respect for it. That said, I don't think I'd want to be a Vi Lisp programmer. One can (and many do) live in both worlds by using Evil but when I switched I decided to go all in and embrace the native interface. I'm glad I did but everyone's different so Evil or even Vi(m) might be a better fit for some. If you're a Vi(m) user and write in Lisp, what has your experience been?

Footnotes:

1 Apparently Vim has improved this situation somewhat in the last few releases. If you're a Vim user and your experience is different, please leave a comment and let us know.

This entry was posted in Programming and tagged , . Bookmark the permalink.