A small neovim plugin to spawn and manage a swank server
This is meant to be used along with a plugin like Conjure. It will start a Swank server inside of a nvim terminal emulator.
- a Common Lisp implementation (sbcl is the default)
- ASDF (this should be included in your Common Lisp implementation)
- Swank (quicklisp is probably the easiest way to get this. Once quicklisp is installed run
(ql:quickload "swank")
in your CL repl)
return { 'spaghettijeff/spank.nvim' }
This plugin provides 3 functions spawn()
, show()
, and quit()
to be bound.
You probably want to put the configuration into ftplugin/lisp.lua
so that it only runs when a .lisp file is open.
Example:
-- ~/.config/nvim/ftplugin/lisp.lua
local spank = require 'spank'
vim.keymap.set("n", "<leader>ss", spank.spawn)
vim.keymap.set("n", "<leader>sS", spank.show)
vim.keymap.set("n", "<leader>sq", spank.quit)
The default command to launch the swank server is
{
'sbcl',
'--eval', '(require "ASDF")',
'--eval', '(asdf:load-system \'swank)',
'--eval', '(swank:create-server :dont-close t)'
}
This can be changed by setting vim.g.spank_settings.swank_cmd
. For example:
-- ~/.config/nvim/ftplugin/lisp.lua
require 'spank'
-- settings ...
vim.g.spank_settings.swank_cmd = {
'sbcl',
'--eval', '(ql:quickload "swank")',
'--eval', '(swank:create-server :dont-close t)'
}