-1

I'm trying to use Steel Bank Common Lisp with GVim.

I installed Steel Bank Common Lisp (AMD64) into 'C:\Program Files\Steel Bank Common Lisp'. I unzipped SLIMV into 'C:\vimfiles' I installed Python3 and put it in Windows PATH. I installed Python 2.7 and put it in Windows PATH. I installed 64-bit GVim and finally got Python recognized. I ran ':helptags C:/vimfiles/doc' in Vim to generate help tags for SLIMV

I have a 'Slimv' menu at the top of the Vim window but no Repl menu. g:slimv_lisp = sbcl g:slimv_impl = sbcl g:slimv_preferred not set g:slimv_lisp not set g:slimv_swank_cmd not set

Per webpages and manual, I put this in my vimrc file

let g:slimv_swank_cmd = '!start "c:\Program Files\Steel Bank Common Lisp\sbcl.exe" -l "c:\Users\epic\vimfiles\slime\start-swank.lisp"'

I don't know if that's supposed to be 'set' instead of 'let'. (start_swank) doesn't do anything inside SBCL.

I assume '!start' is a Vim command, the first thing passed is the location of SBCL on my computer, don't know what the '-l' does, and the third parameter is where SLIMV put 'start-swank.lisp'.

At this point, the Vim command ',c' will open a command window running SBCL and wait. Typing '(exit)' in SBCL will take me back to Vim with a red error message saying 'SWANK server is not running, Press ENTER to continue."

Any other documentation I can find is for SLIME, not SLIMV. How can I get SLIMV running so I can use Vim for SBCL?

EDIT:

Thank you for the help as to what I'm telling to do what, romaini. Thanks for the slimv help, Tamas.

I have removed the g:slimv_swank_cmd entry in .vimrc, as I believe it does the same thing by itself that it would if I had the command right.

Now, I think I'm back to the problem I was trying to fix with that command, and that might be that SBCL is not working for me (?). Without the g:slimv_swank_cmd setting in .vimrc, Vim starts SBCL which then fails because COMPILE-FILE returns NIL when evaluating line 16 of start-swank.lisp. Vim will then report "SWANK server not running" while SBCL is at a debug screen asking whether to RETRY, CONTINUE, ABORT,,,, or EXIT.

Could it be that slimv is working well but SBCL is not working? I'm still trying in Vim to either compile a program (* 3.0 4.0), evaluate the line, or just connect-server ',C'.

EDIT2:

Trying to install a newer version of slimv from GitHub, I'm afraid we've hit the end of my capabilities. The Readme says to install the zip, reading the whole thing says see internal docs for more, and the internal docs say unzip the zip file in the vimfiles directory. There are lots of files on Github but I don't see a zip.

EDIT3:

With slimv-master.zip from github extracted to .vimfiles, I get the same error that "COMPILE-FILE returned NIL" while evaluating line 16 of ./slime/start-swank.lisp.

EDIT4:

Apparently, the SBCL download went from v2.2.0 to V2.2.1 since 01-26-22. I'm on a 64-bit Windows 10 machine and my SBCL download is automatic from SourceForge after clicking Windows-AMD64 here. I have the same issue, ./slime/swank/sbcl.lisp returns NIL from line 16 where COMPILE-FILE returns NIL. It is starting SBCL v2.2.1 now.

EDIT5:

Both my versions of slimv were extracted to ./vimfiles/. My ./vimfiles/slime/slime.el is Version 2.19. Did the newer slimv version not overwrite files when extracting to ./vimfiles/? Is there an uninstall when we're just extracting zips to ./vimfiles/?

EDIT6:

I don't have a check mark next to comments to mark the last of Tamas Kovacs' responses as the answer (as was the rest of his help through the comments). I now have a REPL window in Vim and Tamas solved my issue.

  • 1. `:help :let` is the proper command for defining internal variables. 2. `!start` is not exactly a Vim command. It's `:help :!`, a Vim command that lets you execute external commands from Vim, and `start` a Windows command for starting a program. 3. `-l` doesn't seem to be related to either Vim or `start`. In any case, use the plugin's issue tracker. – romainl Jan 29 '22 at 09:22
  • Use `"!start /MIN ..."` instead of `"!start ..."`, so that the sbcl process is started minimized, running the swank server in the background. Or if you start it in the foreground then don't close it, just leave it running (as it should be communicating with vim) and simply Alt+TAB back to vim. – Tamas Kovacs Jan 29 '22 at 10:38
  • BTW, slimv should autodetect the start command for sbcl, so you don't need to define `g:slimv_swank_cmd` in your `.vimrc`, only in case the autodetection fails. Edit: Maybe the problem is that sbcl uses the `--load` switch for loading a script instead of `-l`. So the swank command should be something like: `'!start /MIN "c:\Program Files\Steel Bank Common Lisp\sbcl.exe" --load "c:\Users\epic\vimfiles\slime\start-swank.lisp"'` – Tamas Kovacs Jan 29 '22 at 10:48
  • Ah, I think I know what the problem is: the slimv version on vim.org is quite old. Please try to download it from the github repository: https://github.com/kovisoft/slimv – Tamas Kovacs Feb 01 '22 at 21:52
  • On the github site when you click on the green "Code" button, then you can find "Download ZIP" in the drop-down list. [This is the link for the zip](https://github.com/kovisoft/slimv/archive/refs/heads/master.zip) of the head version in case you can't find it. – Tamas Kovacs Feb 04 '22 at 18:09
  • What sbcl version are you using? Is it the latest one? It looks like a compatibility issue between sbcl and the swank server. – Tamas Kovacs Feb 04 '22 at 19:28
  • I have just installed sbcl 2.2.1 (X86 version, but I don't think it makes a difference), and it works for me with slimv. Is it possible that you still have an older version of slimv lurking around somewhere in your system? Maybe you installed the latest slimv in the wrong directory and you still have the old version in `vimfiles`? Please check `vimfiles\slime\slime.el, at the beginning of the file there is a `;; Version: 2.26` line, what version is yours? – Tamas Kovacs Feb 04 '22 at 20:54
  • Maybe you simply extracted `slimv-master.zip` into `vimfiles`, so that a `vimfiles\slimv-master` subdirectory has been created by accident. If you peek into the zip file, you can see that the root is `slimv-master`, but you actually need to extract the contents of `slimv-master` into `vimfiles`, so that `slimv-master\ftplugin` goes into `vimfiles\ftplugin`, `slimv-master\slime` goes into `vimfiles\slime`, etc. – Tamas Kovacs Feb 04 '22 at 21:32

1 Answers1

0

I summarize the results of our investigation (see comments above):

  1. No need to set slimv option g:slimv_swank_cmd, because slimv should autodetect sbcl and build the correct start command for the swank server.
  2. If autodetection fails or you want to make your own start command for any other reason, then you should use the --load switch (instead of -l) for loading a script into sbcl (the switch depends on the lisp implementation). On Windows machines I also suggest adding /MIN to the !start command, that would start the swank server minimized. This is an example start command for starting sbcl on Windows:

'!start /MIN "c:\Program Files\Steel Bank Common Lisp\sbcl.exe" --load "c:\Users\epic\vimfiles\slime\start-swank.lisp"'

  1. Unfortunately vim.org has an outdated version of slimv, and recent changes in sbcl broke compatibility with the swank server contained in that slimv version. Therefore I strongly recommend that you download or checkout slimv directly from the github repository: https://github.com/kovisoft/slimv
  2. When downloading the slimv-master.zip file from github and manually installing it, make sure that you extract the files from the zip to the proper subdirectories of the vimfiles folder of vim. This means that the contents of slimv-master\ftplugin should go into vimfiles\ftplugin, slimv-master\slime should go into vimfiles\slime, etc. In other words the slimv-master directory in the zip represents the vimfiles directory on your system. Of course this also holds when you install slimv by checking it out from github.
Tamas Kovacs
  • 1,495
  • 7
  • 9