2

I'm trying to use slimv, which is recommended in the answer for another question of mine, under macOS Sierra. However, when I installed this plugin into ~/.vim/plugin, and ran vi test.lisp, I got the following error. The beautiful "Slimv" menu was also not shown.

sunqingyaos-MacBook-Air:plugin sunqingyao$ vi ~/.vimrc 
Error detected while processing /Users/sunqingyao/.vim/plugin/ftplugin/clojure/slimv-clojure.vim:
line  196:
E117: Unknown function: SlimvInitBuffer
Press ENTER or type command to continue

Note that currently I don't have Clojure installed on my MacBook Air. All what I want to do is to debug some mit-scheme programs inside vim.

Here is the relevant part of ~/.vimrc:

let g:slimv_swank_cmd = '!osascript -e "tell application \"Terminal\" to do script \"mit-scheme --load ~/.vim/plugin/slime/start-swank.lisp\""'

Version information for vim:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2016 21:22:16)
Included patches: 1-898
Compiled by root@apple.com

I'm a vim newbie who don't know much about vim script, so please explain it in detail to me.

Community
  • 1
  • 1
nalzok
  • 14,965
  • 21
  • 72
  • 139
  • Your version of Slimv seems to be outdated. Grab [the current version](https://bitbucket.org/kovisoft/slimv/downloads?tab=tags) and see if it fixes your problems. – romainl Nov 13 '16 at 16:06
  • @romainl Thank you for reminding me for the newest version! Unfortunately however, there still remains an error: `E117: Unknown function: SlimvInitBuffer`. I've edited my question. – nalzok Nov 13 '16 at 16:41

1 Answers1

2

You shouldn't install it into ~/.vim/plugin, you should install it into ~/.vim because slimv has files in other vim directories outside plugin (e.g ftplugin, indent, syntax etc).

Tamas Kovacs
  • 1,495
  • 7
  • 9
  • After I move the whole directory to `~/.vim` and changed the corresponding line in `~/.vimrc` to `let g:slimv_swank_cmd = '!osascript -e "tell application \"Terminal\" to do script \"mit-scheme --load ~/.vim/slime/start-swank.lisp\""'`, no errors occur, but nothing happens(i.e. "Slimv" menu still not shown). Here is the output of `:script`: https://gist.github.com/sunqingyao/aa8bc37f0a570ab4355a405bf5909791 – nalzok Nov 13 '16 at 23:38
  • Did you open/create a .lisp, .clj, or .scm file? Slimv is loaded only when one of the compatible file types are edited in vim. – Tamas Kovacs Nov 14 '16 at 08:16
  • I've tried opening and creating a `.lisp` file, a `.clj` file, and a `.scm` file, but none of these invoked the menu... – nalzok Nov 14 '16 at 13:48
  • Here's the `:script` output when I'm editing a `.scm` file: https://gist.github.com/sunqingyao/5bf5d6a34f9794be7f30556ebf896d6a – nalzok Nov 14 '16 at 13:51
  • From your `:script` output is seems that slimv is loaded (line 25: `~/.vim/ftplugin/slimv.vim`). I don't know what you mean by "...none of these invoked the menu...". The menu isn't automatically invoked. You need to press `,,` (=`,`) to invoke the slimv menu. Well, if you use the gui version of vim with the menu constantly displayed then you should see a new menu item appearing in the menu. – Tamas Kovacs Nov 15 '16 at 08:18
  • Oh yes, after pressing `,,` I saw something like `:emenu: Slimv.Edit.` appeared at the bottom of my terminal, but I still have some problems using it. According to the [document](http://kovisoft.bitbucket.org/tutorial.html#startup), to use slimv, I have to start a "Swank server" first. How can I start it? I've tried `,c`, but vim told me `SWANK server is not running. Press ENTER to continue.` – nalzok Nov 15 '16 at 14:05
  • Here is the error output from a newly-created terminal: `;Loading ".vim/slime/start-swank.lisp"... ;Unbound variable: *load-truename*` – nalzok Nov 15 '16 at 14:25
  • I'm afraid that this goes beyond my competence. As far as I know `*load-truename*` should be bound during the load operation, see e.g. the answer [here](http://stackoverflow.com/questions/25800283/load-file-with-a-relative-path) or the [Hyperspec](http://clhs.lisp.se/Body/v_ld_pns.htm#STload-truenameST). – Tamas Kovacs Nov 15 '16 at 16:08
  • Maybe that's specific to Common Lisp? I've tried to use absolute path, but I got another error: `;Unbound variable: :*fasl-directory*`. Seems that all variables are not bound in my mit-scheme implementation. – nalzok Nov 15 '16 at 16:33
  • Maybe your `g:slimv_swank_cmd` is wrong. I think it should not load `slime/start-swank.lisp` because that's for starting a swank server for lisp. It should load `slime/contrib/swank-mit-scheme.scm` because that's the swank server for MIT-Scheme. – Tamas Kovacs Nov 15 '16 at 22:19
  • WOW IT WORKS LIKE MAGIC NOW! Thank you very much! – nalzok Nov 16 '16 at 00:45
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/128217/discussion-between-sun-qingyao-and-tamas-kovacs). – nalzok Nov 16 '16 at 01:48