A less-known feature of Vim is support for Scheme, for scripting or otherwise. At the time of the original integration, the MZScheme package (a subset of PLTScheme) was used. Eventually, this became Racket. However, in Vim configuration, help, etc, mzscheme
is referred to.
The following steps were performed on Ubuntu 14 Server, in order to compile Vim with Scheme support.
To determine whether Vim has been compiled with support for Scheme:
In Vim, :version
will likely display -mzscheme
, reflecting a lack of Scheme support. Once the steps below are complete, this will become +mzscheme
.
- downloaded, extracted racket-5.3.6-src-unix.tgz (note version 5.3.6) from download.racket.com
- ./configure --prefix=/usr
- make
- sudo make install
I believe, the key difference between this and **other installations was the creation of /usr/lib/libracket3m.a
sudo apt-get install racket
- latest (6.1.1) Ubunutu package from download.racket.com
**Both of these methods successfully installed Racket, but Vim's configure failed to properly link to Racket libs.
- git clone https://github.com/b4winckler/vim.git ~/vim
- cd ~/vim
- make distclean
- ./configure --enable-multibyte --with-features=big --prefix=/usr --enable-mzschemeinterp
- make
- sudo make install
Note that at the time of writing, this resulted in Vim version 7.4.430.
Another look at :version
should yield +mzscheme
Now in Vim :mz (+ 1 1)
output is 2
Eval the current buffer :call mzeval(join(getline(1, $)))
Or :mzfile <filename>
:help mzscheme
for more ways to interact with text, buffers, etc.
This didn't work for me with racket 7.4 unix source.
Here's what did work:
vim/vim#2596 (comment)