kovisoft / slimv

Official mirror of Slimv versions released on vim.org
455 stars 60 forks source link

Installation via Plugin Manager? #122

Closed conor-f closed 2 years ago

conor-f commented 2 years ago

Is there any way to install slimv using a plugin manager like Plug? I haven't had any luck yet installing it from following the instructions.

kovisoft commented 2 years ago

TBH, I have never used any plugin manager, but other users reported that they installed and used slimv with pathogen or vundle. Maybe I can try to assist you if you tell what kind of problems you had.

conor-f commented 2 years ago

Thank you for your fast response!

I added the line Plug 'kovisoft/slimv' to my .vimrc and then opened up a new instance of vim and ran :PlugInstall which says it successfully installed slimv. However, when I open a file (e.g. test.rkt or test.lisp) I don't see any REPL open up and any , commands have no effect (e.g. ,b which I think should run the buffer?)

I have /usr/share/common-lisp/source/slime/start-swank.lisp also after running sudo apt install slime.

You can try out my setup by cloning this branch of my repo: https://github.com/conor-f/vim-stuff/tree/slimv and running make slimv_install. This shouldn't affect your existing vim setup, but take precautions anyways if you can't readily reproduce your current setup!

kovisoft commented 2 years ago

On a virtual machine I created an empty .vim/ directory and an empty .vimrc file. The I did everything as described in the Plug documentation:

I checked the directory structure and the slimv files were downloaded into .vim/plugged/slimv/ in the usual vim hierarchy (ftplugin, indent, plugin, syntax, etc subdirectories). You don't need to install a separate slime, it is also contained in .vim/plugged/slimv/slime/.

I suggest that you try to repeat the above steps. When you finally load a .lisp file into vim, then check what scripts are loaded via :scriptnames.

conor-f commented 2 years ago

Thank you for making such an effort to reproduce my issue :)

Using your detailed description, I think I narrowed down the issue slightly. I use i3 + Ubuntu 20.04 and didn't have xterm installed. After installing xterm and using ,c to connect when within a Lisp file, I had better results :) Two follow up questions though:

1) :echo SlimvSwankCommand() outputs ! SWANK_PORT=4005 xterm -iconic -e "sbcl" --load "/home/conor/Code/vim-stuff/.vim/plug_plugins/slimv/slime/start-swank.lisp" & which seems correct, but it causes a new xterm window to pop up which needs to be manually closed when finished with. Is it supposed to be running in the background or is this expected behavior? 2) I tried using ,c when editing a file named test.rkt to see if it would work with racket but it didn't have any reaction. Does slimv support racket? Or just Scheme?

kovisoft commented 2 years ago
  1. The expected behavior is that the new xterm window remains running even if you exit vim. Slimv does not close the swank server upon exit. If you later on start vim again, and open a new REPL buffer, then slimv is going to connect to the existing instance (no new xterm window is opened) and you have your previous lisp environment available. If you no longer need it, you can manually close the swank server, then slimv will open a new xterm window when opening a new REPL buffer.
  2. Scheme is supported by slimv, but racket is currently not fully supported. I guess it is possible to use slimv with racket files with a little tweaking, like manually setting the swank command, and forcing the filetype to scheme, but I have no experience with it. You can try to add this to your .vimrc file in order to identify .rkt files as scheme files:
au BufNewFile,BufRead *.rkt setf scheme
conor-f commented 2 years ago

Thanks for your help kovisoft :) I understand slimv better now and how to use it.