Programming Scheme(Racket) with VIM – How to get started

If you just want to load a file into Racket on the command-line and run it, I think that this should work:

$ racket -f file.scm -i

The -i option would leave you at the REPL to test your code in file.scm.

However, you might want to take a look at this blog post:

Like Slime, for Vim

You can set up a GNU screen session running the command-line Racket, and send s-expressions to it from Vim. There’s a link to a bit of Vimscript which will make this automatic. I used this for a while with mit-scheme, and it was reasonably effective. It’s not quite the as powerful as SLIME or DrRacket though. I just tested the steps described on OS X and it works with the command-line racket, it should work on Ubuntu, that’s what I was using when I first used this method.

You might also want to take a look at this:

http://evalwhen.com/scmindent/index.html

… which has some information on better indentation in Vim for Lisp and Scheme code.

I eventually switched to Emacs, but don’t let the Vim haters get you down. Paul Graham supposedly uses vi and he’s gotta be one of the top 5 most prominent Lisp programmers.

http://paul.graham.usesthis.com/

Leave a Comment

tech