2017-05-08 Using VIM to edit Lisp code --------------------------- This is the relevant section of my ~/.vimrc file. These settings are useful for non Lisp code, and non-code as well. set nocompatible set lines=24 columns=80 syntax on set expandtab set tabstop=2 set shiftwidth=2 When I open a Lisp file, I turn on two more flags manually: :set lisp ai (To edit non-Lisp code, I only turn on "ai"). Now VIM's indentation operation (=) will indent using Lisp style. E.g. to indent an s-expression like: (defun f (x) (* x x)) position your cursor at its opening parenthesis and type: =% Doing: :set syntax=lisp or :set syntax=scheme as appropriate, will give you syntax highlighting if VIM hasn't detected the programming language automatically. It's useful to leave a blank line between functions, then use the paragraph movement command, }, to navigate to the next function. While programming, I reload a whole Lisp file at a time, if not a whole Lisp project. Sometimes, I define a function with an easy-to-type name, "rl", that loads just the file that I'm working on, and performs any reinitialization needed. Programming consists of changing code in my editor, then running "(rl)" in Lisp to bring it all in. I don't like VIM's indentation of the "do" form. Whenever I don't like VIM's default indentation, I manually indent that part of my code to be how I like it. The Lisp REPL ------------- CLISP has the best readline integration. When you scroll to historical expressions you typed in, it understands whole expressions, even if they were multi-line. For other Common Lisp implementations, I use rlwrap, a readline wrapper. If you launch, e.g. sbcl, as: rlwrap sbcl you'll get decent REPL editing facilities. But not as good as CLISP's.