I'm using MacVim (kind of gvim for OSX) and try to get the slimv plugin running. Sadly it's not working out of the box. In fact, it does not start up at all.
My setup:
- MacVim (32bit cause of this) (vim 7.3)
- :scriptnames does not list
ftplugin/slimv.vim
whileplugin/paredit.vim
is listed - :set ft? shows
filetype=lisp
for .lisp files - :messages shows no errors
- :filetype
filetype detection:ON plugin:ON indent:ON
- :echo g:paredit_loaded
1
- :echo g:slimv_loaded
E121: Undefined variable: g:slimv_loaded \ E15: Invalid expression: g:slimv_loaded
- compiled with +python (2.7)
SBCL and slime are installed - works flawless with emacs.
I tried it with and without let g:slimv_swank_cmd = ...
in .vimrc and changed the line recommended on the plugin page from
let g:slimv_swank_cmd = '!osascript -e "tell application \"Terminal\" to do script \"sbcl --load ~/.vim/slime/start-swank.lisp\""'
to
let g:slimv_swank_cmd = '!sh -c "sbcl --load /Applications/MacVim.app/Contents/Resources/vim/runtime/slime/start-swank.lisp" &'
since the osascript was not working and I don't know how to fix it. But a similar call to xterm is sufficient for Linux so my sh call should be fine. Well, I got no idea what to try next. :/
The problem got solved by installing slimv to ~/.vim instead of the vim ebedded in MacVim. Maybe some kind of bug? However, Common Lisp + vim - I just love it.
Because moving the slimv plugin to
~/.vim
fixed it, I suspect the problem is that MacVim's default/Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin/lisp.vim
is being sourced before theftplugin/lisp/slimv-lisp.vim
file provided with slimv.Both of those files (
lisp.vim
andslimv-lisp.vim
) start with code like this:and so whichever file gets sourced first will prevent the other file from running since vim does
finish
(exits the script) if it detects that another *lisp*.vim script was run previously and therefore set theb:did_ftplugin
buffer-local variable.You can tell this is happening by running MacVim from the command line with the arguments:
Then quit the MacVim session that starts up, and look at the macvim-log.txt file it created.
Search for
b:did_ftplugin
and you'll see it referenced each timelisp.vim
orslimv-lisp.vim
runs, and you can see thatlisp.vim
runs first, which preventsslimv-lisp.vim
from working.Moving your slimv install from the
/Applications/MacVim.app/
dir to your~/.vim
dir will change the order so thatslimv-lisp.vim
is sourced beforelisp.vim
, and then slimv will work.