Lisp in Vim – Susam Pal

By Susam Pal on 07 Dec 2019
Introduction
Fifteen years ago, writing Lisp code in Vim was an odd adventure.
There were no good plugins for Vim that assisted in structured
editing of Lisp s-expressions or allowed interactive programming by
embedding a Lisp Read-Eval-Print-Loop (REPL) or a debugger within
the editor. The situation has improved a lot since then. In the
last ten years, we have seen active development of two Vim plugins
named Slimv and
Vlime. Slimv is over
10 years outdated now. Vlime is more moderen and fewer than 3 years outdated
proper now. Each assist interactive programming in Lisp.
I’m going to debate and evaluate each Slimv and Vlime on this
article. I’ll present how one can get began with each plugins and
introduce a few of their fundamental options. I cannot cowl the whole lot
although. This isn’t a tutorial. For tutorials, see
the References part.
If you’re trying just for a comparability of the 2 plugins or a
fast advice, bounce on to the
Comparison of Slimv and Vlime
part or the
Quick Recommendation
part.
Contents
Background
Before we get started with Slimv and Vlime, it would be nice to take
a brief look at the heritage behind these plugins. These plugins
provide Lisp development environments for Vim, so their story begins
with Lisp.
Lisp
Lisp is a family of programming languages with a distinctive, fully
parenthesized prefix notation. It is quite unlike most of the other
popular programming languages today like C, Python, Ruby, etc. Its
homoiconic nature and its powerful macro system that can transform
arbitrary Lisp expressions make it such a flexible, versatile,
extensible, and introspective language that articles describing Lisp
often have the word “enlightenment” in them. For example, see the
following articles:
Lisp has been described in various ways by various eminent
personalities in the history of computing. Alan Kay has famously
described Lisp as:
The greatest single programming language ever designed.
John Foderaro has written this about Lisp:
Lisp is a programmable programming language.
Eric S. Raymond has expressed the enlightenment one experiences by
learning Lisp in his famous article titled
How To Become A Hacker:
Lisp is value studying for the profound enlightenment expertise you
can have once you lastly get it. That have will make you a
higher programmer for the remainder of your days, even in the event you by no means
really use Lisp itself lots.
Randall Munroe, the creator of the
XKCD webcomic has devoted two
comedian strips to Lisp:

(Supply: https://xkcd.com/224/)

(Supply: https://xkcd.com/297/)
Developed in 1958 by John McCarthy, Lisp is the second oldest
programming language in use as we speak. Solely Fortran is older, by one
yr. There are three Lisp dialects widespread as we speak: Widespread Lisp,
Scheme, and Clojure. Most of this text would concentrate on Widespread
Lisp. Scheme and Clojure could be mentioned briefly in the direction of the top
of this text.
Emacs: SLIME
Many Lisp programmers immediately think of Emacs when they think of
writing Lisp code. Emacs is a family of text editors. An Emacs
editor itself is typically implemented in a dialect of Lisp. There
is an Emacs mode named SLIME that provides excellent support for
programming in Lisp. SLIME stands for Superior Lisp Interaction
Mode for Emacs. First released in August 2003, SLIME was created by
Eric Marsden and then later developed further by Luke Gorrie and
Helmut Eller. It offers a Read-Eval-Print-Loop (REPL), integrated
debugging, and interactive evaluation of expressions, all available
right within the editor. There are several nifty key bindings
available to compile and evaluate parts or whole of the code in the
current buffer.
SLIME works by launching a Swank TCP server. Swank is a backend
server program written in Common Lisp that listens on a socket to
receive SLIME commands from Emacs and execute them. SLIME is so
useful that it is considered to be indispensible by many Lisp
programmers who write Lisp code in Emacs.
Vim: Slimv/Vlime
Is there anything similar to SLIME for Vim? Yes, there are two
popular options:
-
Slimv: It stands for Superior Lisp Interaction
Mode for Vim. It is a Vim plugin created by Tamas Kovacs that
was first released in January 2009. -
Vlime: It is a Vim plugin created by Kay Z that
was first released in May 2017. It is much more recent than
Slimv. Vlime is younger than Slimv by eight years.
Both plugins use a client-server architecture like SLIME does in
Emacs. Both plugins rely on Swank server to be started. In fact,
Slimv bundles a slightly modified version of Swank with it, so that
it can launch it and connect to it to send expressions to be
evaluated. Vlime does not bundle Swank server with itself but it
provides a wrapper that automatically downloads Swank server when
needed.
Vim Plugin Management
When I started using Vim fifteen years ago, we used to just download
a Vim plugin and copy/extract it to ~/.vim
directory.
These days, there are a few plugin management tools for Vim such
as Pathogen,
Vundle,
vim-plug, and so forth. I
am not going to make use of any of them as a result of I do not know which considered one of
them you utilize and I do not need to write down steps for every considered one of
them.
In reality, I’ve by no means used any Vim plugin supervisor myself. Till Vim
7, I used to create a ~/.vim/bundle
listing, then
copy every plugin to its personal listing inside it, and add the
plugin’s listing path to Vim’s runtimepath
choice.
Vim 8 has native assist for packages which makes putting in plugins
and loading them easier. With Vim 8, we will copy every plugin to
its personal listing inside ~/.vim/pack/plugins/begin
and
they’re loaded robotically when Vim begins. The listing identify
plugins
on this path is just an instance. It might be
any arbitrary identify and Vim would nonetheless load the plugins high-quality.
On this article, I’ll use Vim 8’s native assist for packages to
arrange Vim plugins. The one exception to this could be putting in
Vlime. The highest-level listing of Vlime shouldn’t be the plugin
listing. The plugin listing is contained in a subdirectory
named vim
. This doesn’t conform to the listing
construction of plugins in a Vim package deal. Due to this fact, on this article,
I’ll arrange Vlime within the quaint method by copying it
to ~/.vim/bundle
after which including the trail to its plugin
listing to Vim’s runtimepath
choice.
Software program Variations
Since this article involves several layers of software, some of what
is written here may not hold good in future as these various pieces
of software change and evolve over time. Therefore, in this
section, I will note down the versions of various software tools I
used while writing this article. Here they are:
- Debian GNU/Linux 10.1 (buster)
- Vim 8.1
-
Slimv (Git repo last updated on 30 Nov 2019 with commit
47a0070) -
Vlime (Git repo final up to date on 16 Oct 2017 with commit
065b95f) -
Paredit (Git repo final up to date on 30 Nov 2019 with commit
d99905a) -
Rainbow Parentheses (Git repo final up to date on 29 Oct 2015 with commit
27e7cd7) - SBCL 1.4.16.debian
- GNU CLISP 2.49.92
- ECL 16.1.3
- MIT/GNU Scheme 9.1.1 on Debian GNU/Linux 9.11 (stretch)
- Clojure 1.10.1
- Quicklisp beta (libraries final up to date on 30 Nov 2019)
- tmux 2.8
You’ll in all probability want solely a tiny subset of the instruments above
relying on which sections on this article you’ll observe. Simply
choose the sections you need to check out and observe the steps written
in them. They may stroll you thru the process to put in the
instruments relevant to the sections you could have picked. No matter
which sections you choose, I like to recommend that you simply positively undergo
the three “Get Began” subsections beneath. These subsections go
into element about a few of the stipulations equivalent to assist for
tmux, Paredit, assist for Python interface in Vim, and so forth. which are
not lined within the different sections.
The selection of Debian could appear like an odd one. I need the instructions
and steps mentioned on this article to be simply reproducible in a
free and open supply working system. Debian occurs to be my
favorite. What works on Debian is definitely reproducible on Ubuntu
and different derivatives, usually with none adjustments to the steps. I
imagine, it won’t be too troublesome to translate the steps
offered for Debian to the steps that may work on one other
working system.
Notice that Quicklisp (a prerequisite for Vlime) continues to be beta
software program on the time of writing this text. The precise steps to
set up Quicklisp could change in future. Verify
https://www.quicklisp.org/
for essentially the most up-to-date directions to put in Quicklisp.
Get Began
Get Started with Slimv and SBCL
Here are the steps to set up Slimv and use it:
-
Install the tools required to set up a Common Lisp development
environment with Slimv with this command:sudo apt-get install vim-nox sbcl tmux git
The default Vim in Debian is
vim.basic
provided by
thevim
package which does not have support for
Python interface. Slimv is written in Vim script, Lisp, and
Python 3, so it does need a Vim package that has support for
Python interface. One such package isvim-nox
that
provides thevim.nox
command. Installing it
automatically updates thevim
command to
runvim.nox
. Another such package
isvim-gtk
which additionally provides GUI support.
The graphical Vim known as GVim can be launched with
thegvim
command. It runs in the desktop
environment. For the purpose of this article, I will stick
tovim-nox
because it is lightweight. All steps
meant for Slimv would run equally well onvim-gtk
,
MacVim, and GVim.Installing tmux is optional. Slimv can launch Swank server
automatically if Vim is running within tmux, GNU Screen, or a
desktop environment, so if you are using GNU Screen already, you
don’t need to install tmux. Also, if you are running Slimv in a
desktop environment, you don’t really need to install either
tmux or GNU Screen, although you could if you would like to see
Swank running in a separate tmux or GNU Screen window rather
than a separate terminal window. In this article, I am going to
assume that Vim is running within tmux.If you are going to run Slimv in a terminal without a desktop
environment, tmux, or GNU Screen, Swank server has to be run
manually. Point 4 below explains how to do it. -
Installing Slimv is pretty simple. Here is one way to do it:
git clone https://github.com/kovisoft/slimv.git ~/.vim/pack/plugins/start/slimv vim +'helptags ~/.vim/pack/plugins/start/slimv/doc' +q
That is it! Slimv is set up. It’s that straightforward. The
commands above show how to set up Slimv with just two shell
commands. You could also use a Vim plugin manager to install
Slimv for you but I am not going to cover that here. -
This is an optional step. Slimv supports starting Swank server
automatically if you are running Vim in tmux, GNU Screen, or a
desktop environment. To start tmux, enter this command:tmux
If you use GNU screen or a desktop environment, you don’t have
to run tmux.If you do not use tmux, GNU Screen, or a desktop environment,
then you must start Swank server manually as explained in the
next point. -
This step is necessary only if you are not using tmux, GNU
Screen, or a desktop environment. The following command shows
how to start Swank server manually:sbcl --load ~/.vim/pack/plugins/start/slimv/slime/start-swank.lisp
If you are using tmux, GNU Screen, or a desktop environment,
Slimv can start Swank server automatically when needed and you
don’t need to perform this step. -
Create a new Lisp source code file, say,
foo.lisp
with this command:vim foo.lisp
-
To connect to Swank server, enter the following command in
normal mode:,c
If Vim is running within tmux, GNU Screen, or desktop
environment, Slimv would automatically launch Swank server and
connect to it.After Slimv connects to Swank successfully, Vim window should
split into two and the following prompt should appear in the new
split window:CL-USER>
This is the integrated REPL. It is now alive and ready for
interactive programming.We assume here that Slimv is using the default Slimv leader
key ,. If you have overridden the Vim leader key,
then the Slimv leader key might be same as the Vim leader key.
Enter the command:echo g:slimv_leader
in Vim
command-line mode to find the leader key being used by Slimv. -
Type some code into the buffer for the new file. To do so,
first type i to enter insert mode and type this code:(format t "hello, world~%")
Type esc to return to normal mode.
-
To evaluate the current expression under the cursor, enter the
following command in normal mode:,e
Both the current expression and its result should appear in the
REPL window. -
The REPL is interactive. Type
ctrl+ww to switch to the REPL
window. Then type i to enter insert mode and type
this code:(+ 1 2)
Type enter to evaluate the expression just like you
would do in a real REPL. The result should then appear in the
REPL.Type esc to return to normal mode again. Use the
normal mode command
ctrl + w w to
switch between the split windows. -
Now that you have got started with Slimv, here is a brief note
on uninstallation, in case you ever need it. If Slimv is
installed as described in point 2 above, enter the following
command to uninstall it:rm -rf ~/.vim/pack/plugins/start/slimv
In steps 7 and 9, you may have noticed that as soon as you type an
opening parenthesis or double quotation mark, a matching closing one
is automatically inserted. That is done by the
Paredit plugin
which is bundled together with Slimv. Paredit ensures structured
modifying of Lisp s-expressions and retains all matched characters
(parentheses, brackets, braces, quotes) balanced. It additionally supplies
many new keybindings to edit s-expressions conveniently. We’ll
look into Paredit in a little bit extra element in
the Get Started with
Paredit subsection later.
Get Began with Vlime and SBCL
Here are the steps to set up Vlime and use it:
-
Install the tools required to set up a Common Lisp development
environment with Vlime with this command:sudo apt-get install vim sbcl git curl
Note that unlike Slimv, Vlime can work with the default Vim in
Debian, i.e.,vim.basic
. Vlime does not require
Vim with Python interface. -
Install Quicklisp with these commands:
curl -O https://beta.quicklisp.org/quicklisp.lisp sbcl --load quicklisp.lisp --eval '(quicklisp-quickstart:install)' --eval '(exit)' sbcl --load ~/quicklisp/setup.lisp --eval '(ql:add-to-init-file)' --eval '(exit)'
Type enter in the end, when prompted, to complete the
installation. -
Install Vlime and Paredit with these commands:
git clone https://github.com/l04m33/vlime.git ~/.vim/bundle/vlime git clone https://github.com/kovisoft/paredit ~/.vim/pack/plugins/start/paredit echo 'set runtimepath^=~/.vim/bundle/vlime/vim' >> ~/.vimrc vim +'helptags ~/.vim/bundle/vlime/vim/doc' +'helptags ~/.vim/pack/plugins/start/paredit/doc' +q
Unlike Slimv, Vlime does not bundle
Paredit alongside
with itself. As defined within the earlier part, it helps us
with structured modifying of Lisp s-expressions.I like to recommend that you simply set up Paredit however in case you select not
to, be sure that loading of filetype plugins is enabled by
coming into the:filetype
command in command-line
mode. The output ought to compriseplugin:ON
. If it
is off, add the commandfiletype plugin on
to~/.vimrc
to make sure that that is all the time on.
Vlime will not work with out this being enabled. When you set up
Paredit, you do not have to trouble about this as a result of Paredit
takes care of enabling this by default. -
Create a brand new Lisp supply code file, say,
foo.lisp
with this command:vim foo.lisp
-
To start out Vlime server (a wrapper round Swank server) and
connect with it robotically, enter the next command in
regular mode:rr
We assume right here that Vim
<LocalLeader>
is left
to its default, i.e., backslash. Whether it is mapped to another
key mixture, then that have to be used as a substitute of backslash in
the above command.The primary time this command is run after putting in Vlime, it
installs Swank server utilizing Quicklisp. Due to this fact, it may well take a
whereas for Vlime server to begin the primary time this command is
run. On subsequent use of those instructions, it could begin quicker
as a result of it could be already put in.The console output from Vlime server is displayed in a break up
window. After Vlime efficiently connects to Swank, the
following message is displayed on the backside:Vlime Connection 1 established.
After the above message seems, it’s okay to shut the break up
window for Vlime server by coming into this command in Vim
command-line mode::q
Vlime server would proceed to run in background. The next
command can be utilized in regular mode to view the console output of
Vlime server anytime it’s required:rv
-
Kind some code into the buffer for the brand new file. To take action,
first kind i to enter insert mode and sort this code:(format t "howdy, world~%")
Kind esc to return to regular mode.
-
To guage, the present expression below the cursor, enter the
following command in regular mode:ss
Each the present expression and its consequence ought to seem within the
REPL window.In contrast to Slimv, the REPL window of Vlime is not
interactive. Itsnomodifiable
choice is ready, so we
can’t kind code instantly into the REPL window. This is usually a
little bit of an issue if we need to kind arbitrary expressions into
the REPL and execute them. To mitigate this shortcoming to some
extent, Vlime supplies an alternate strategy to consider the
present expression referred to as the interplay mode. That is
defined within the subsequent level. -
Allow interplay mode by coming into this command in regular mode:
i
The identical command disables interplay mode, i.e., this command
toggles the state of interplay mode between on and off. When
interplay mode is on, consider an expression below the cursor
by merely urgent enter in regular mode. -
Now that you’ve got began with Vlime, here’s a temporary observe
on uninstallation, in case you ever want it. If Quicklisp and
Vlime are put in as described within the factors 2 and three above,
run these instructions to uninstall them:rm -rf ~/quicklisp ~/.vim/bundle/vlime ~/.vim/pack/plugins/begin/paredit sed -i.bkp '/runtimepath.*vlime/d' ~/.vimrc
Optionally, take away
~/.sblrc
or edit it to take away
the code pertaining to loading
quicklisp/setup.lisp
.
Get Began with Paredit
You have already got started with Paredit when you wrote Lisp code
while following one of the previous two subsections. The moment you
typed an opening parenthesis, Paredit inserted a closing one for you
automatically. Paredit keeps all matched characters such as
parentheses, double quotes, etc. balanced when you edit code. Here
is a very brief exercise to quickly get started with some of the
very basic features of Paredit:
-
Create a new Lisp source code file, say,
foo.lisp
with this command:vim foo.lisp
-
Type i to enter insert mode and then type only this:
(defun square (x
At this point, Paredit should have inserted the two closing
parentheses automatically. The code should look like this:(defun square (x))
The cursor should be situated just after the parameter
x
. The block above shows where the cursor should
be. -
While you are still in insert mode, type the first closing
parenthesis. Yes, type it even if the closing parenthesis is
already present. The cursor should now skip over the first
closing parenthesis like this:(defun square (x))
Of course, there was no need to type the closing parenthesis
because it was already present but typing it out to skip over it
is more efficient than escaping to normal mode, then moving over
it, and then entering insert mode again. This is, in fact, a
very nifty feature of Paredit. We can enter code with the same
keystrokes as we would without Paredit. -
You should still be in insert mode. Type enter to
create a new line below. Now one of two things is going to
happen. If electric return is disabled, then a newline is
inserted as expected like this:(defun square (x)) )
If electric return is enabled, two newlines are inserted to
create an empty line in between:(defun square (x) )
In both cases, indentation of two spaces is inserted
automatically. The new empty line inserted by electric return
allows linewise editing of the code to be entered in this empty
line.The electric return feature is enabled by default in both
Paredit and Slimv. It works by Paredit remapping the “enter”
key (<CR>
) in insert mode to a function that
inserts electric return. Slimv needs to remap the “enter” key
to present the argument list of the current function but it
takes care of performing an electric return before showing the
argument list. Vlime, however, forgets to perform electric
return before showing the argument list, so this feature does
not work in Vlime.For now, we will continue with the assumption that electric
return is enabled and working fine. If it is disabled or if it
is not working for you, ignore the steps that discuss electric
return. -
Now, type only this:
(* x x
Again, Paredit would have inserted the closing parenthesis
automatically. The code should look like this now:(defun square (x) (* x x) )
-
Now, type one more closing parenthesis to advance past the
automatically inserted closing parenthesis like this:(defun square (x) (* x x) )
-
Then type another closing parenthesis. Paredit would now pick
the lone closing parenthesis that is present in its own line and
move it at the end of the current line like this:(defun square (x) (* x x))
This behaviour of consuming the extra newline inserted by an
electric return on typing a closing parenthesis helps the code
to conform to the popular Lisp coding convention of putting all
the consecutive closing parentheses next to each other in the
same line. In other words, typing closing parentheses
re-gathers electric returns when applicable. -
Let us see what happens if we try to delete the opening
parenthesis around the product function (the*
function). Type esc to return to normal mode. Then
enter h in normal mode to move the cursor one place
left so that the cursor is placed on the parenthesis just after
the lastx
in the code like this:(defun square (x) (* x x))
Type x to delete the closing parenthesis the cursor
is on. Nothing gets deleted! Instead the cursor just skips
over the parenthesis like this:(defun square (x) (* x x))
Paredit refuses to delete the closing parenthesis because it
encloses a non-empty list. It would have deleted the closing
parenthesis along with the opening one if the list were empty.
This is Paredit trying to ensure that the s-expressions remain
valid while editing.Note that in this step, h is a regular Vim motion
command. In Vim, by default, x deletes the character
under the cursor, but when Paredit is enabled, it remaps this
command to behave the way it did in this step to ensure that the
parentheses remain balanced. -
Let us now try to delete the current line. Type
dd to do so. The result looks like this:(defun square (x) )
Note how the closing parenthesis has been left intact to keep
the parentheses balanced. Again, Paredit has remapped the
dd command to produce this behaviour. -
Now type da( to delete the
entiredefun
expression. The buffer should look
empty now. -
Type i to enter insert mode and type out the
following code:(list (* 10 20) (+ 30 40))
-
Type esc to return to normal mode.
Type h(hh to place
the cursor on the closing parenthesis of the first expression.(list (* 10 20) (+ 30 40))
Now type ,>. The closing parenthesis
of the first expression moves right to slurp the next
expression. The buffer looks like this:(list (* 10 20 (+ 30 40)))
We assume here that Paredit is using the default Paredit leader
key ,. If you have overridden the Vim leader key,
then the Paredit leader key might be same as the Vim leader key.
Enter the command:echo g:paredit_leader
in Vim
command-line mode to find the leader key being used by Paredit. -
Now type ,<. The closing parenthesis
of the outer expression moves left to barf the inner
expression out. The buffer looks like this again:(list (* 10 20) (+ 30 40))
While the cursor is on a parenthesis, the normal mode
commands,<
or,>
can be used in
this manner to move the parenthesis left or right, respectively,
thereby slurping or barfing expressions.
That was a very brief overview of what Paredit can do. There is a
lot more to Paredit than what is described above. Paredit has a
rich set of keybindings to make editing s-expressions very
convenient. Enter :help paredit-keys
in command-line
mode to see the list of the keybindings.
I think it is a good idea to read the entire Paredit documentation.
Enter :help paredit
to do so. It is about 500 lines
long and takes about 30 to 40 minutes to read. The time spent
reading this documentation is worth it because it makes editing Lisp
code very pleasant and productive.
Use Debugger and Inspector
After getting started with Slimv or Vlime, the very next thing you
might want to know is how to work with the debugger. The debugger
window comes up whenever an error or an unhandled condition occurs.
It might look quite scary to a beginner, so it is a good idea to
become comfortable with it as soon as possible. Fortunately, both
Slimv and Vlime provide excellent key-bindings to inspect the error
or dismiss it to return to the source code buffer quickly and
easily.
Use Debugger and Inspector with Slimv
The following steps trigger an error and then show how to work with
the debugger in Slimv:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defun square (x) (* x x)) (square "foo")
-
Enter ,b to evaluate the buffer.
-
As soon as the defective form
(square "foo")
gets
evaluated, an error occurs. The error, possible restarts, and
the backtrace is displayed in a new split window for SLDB. SLDB
stands for Slime Debugger. Here is an example of what may
appear in the SLDB window:The value "foo" is not of type NUMBER when binding SB-KERNEL::X [Condition of type TYPE-ERROR] Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [*ABORT] Return to SLIME's top level. 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1003274E23}>) Backtrace: 0: (SB-KERNEL:TWO-ARG-* "foo" "foo") [external] 1: (SQUARE "foo") 2: (SB-DEBUG::TRACE-CALL #<SB-DEBUG::TRACE-INFO SQUARE> #<FUNCTION SQUARE> "foo") 3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SQUARE "foo") #<NULL-LEXENV>) 4: (EVAL (SQUARE "foo")) 5: (SWANK::EVAL-REGION "(defun square (x) ..) 6: ((LAMBDA NIL :IN SWANK-REPL::REPL-EVAL)) ...
The ellipsis in the end is added by me to denote that the actual
output has been truncated in this article for the sake of
brevity. -
In the SLDB window, move the cursor to the second line of
backtrace, i.e., on the following line:1: (SQUARE "foo")
Then type enter. This line should now unfold to show
the following details:1: (SQUARE "foo") in "(SB-INT:NAMED-LAMBDA SQUARE----------------------------------- Locals: X = "foo"
-
Move the cursor to the line that begins with
in
,
i.e., on this line:in "(SB-INT:NAMED-LAMBDA SQUARE-----------------------------------
Then type enter. Some information about its source
code should appear like this:1: (SQUARE "foo") in "(SB-INT:NAMED-LAMBDA SQUARE (X) (BLOCK SQUARE (#:***HERE*** (* X X))))" byte 1 Locals: X = "foo"
-
Move the cursor to the following line:
X = "foo"
Then type ,i to inspect this variable. A
prompt would appear to confirm the variable name. Type
enter to confirm. An inspector window should now
appear with more details about this variable. This window should
look like this:Inspecting #<(SIMPLE-ARRAY CHARACTER (3)) {100478AFAF}> -------------------- Press <F1> for Help Dimensions: (3) Element type: CHARACTER Total size: 3 Adjustable: NIL Fill pointer: NIL Contents: 0: #f 1: #o 2: #o [<<] Exit Inspector
-
Type enter to inspect any object under the cursor and
drill down further. -
Type backspace in normal mode to return to the
previous object. -
Enter ,q in normal mode to quit the
inspector. -
Finally, move the cursor to the following line in the SLDB
window:1: [*ABORT] Return to SLIME's top level.
Then type enter to execute this restart.
Alternatively, enter ,a in normal mode to
select the abort restart and quit to the previous level or
,q to quit to top level.
Most of the times when an error occurs, I quickly take a look at the
stack trace to realize that I have made a silly mistake and enter
the ,q command to abort and quit to top level.
This can be quite convenient because it allows returning from
debugging to coding very quickly with only two keystrokes.
Use Debugger and Inspector with Vlime
The following steps trigger an error and then show how to work with
the debugger in Vlime:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defun square (x) (* x x)) (square "foo")
-
Save the file, connect to Vlime server, and enter
of in normal mode to compile
the entire buffer. -
As soon as the defective form
(square "foo")
gets
evaluated, an error occurs. The error, possible restarts, and
the backtrace is displayed in a new split window for SLDB. SLDB
stands for Slime Debugger. Here is an example of what may
appear in the SLDB window:Thread: 1; Level: 1 The value "foo" is not of type NUMBER when binding SB-KERNEL::X [Condition of type TYPE-ERROR] Restarts: 0. *ABORT - Return to SLIME's top level. 1. ABORT - abort thread (#<THREAD "worker" RUNNING {10045D6F83}>) Frames: 0. (SB-KERNEL:TWO-ARG-* "foo" "foo") [external] 1. (SQUARE "foo") 2. (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/susam/foo.fasl" {10045E76A3}> :TABLE #(41 #<PACKAGE "SB-IMPL"> SB-IMPL::%DEFUN #<PACKAGE "COMMON-LISP-USER">.. 3. (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/susam/foo.fasl" {10045E76A3}> NIL NIL) 4. ((FLET SB-FASL::THUNK :IN LOAD)) 5. (SB-FASL::CALL-WITH-LOAD-BINDINGS #<CLOSURE (FLET SB-FASL::THUNK :IN LOAD) {7F7B9B0B60BB}> #<SB-SYS:FD-STREAM for "file /home/susam/foo.fasl" {10045E76A3}>) ...
The ellipsis in the end is added by me to denote that the actual
output has been truncated in this article for the sake of
brevity. -
In the SLDB window, move the cursor to the second line of
backtrace, i.e., on the following line:1. (SQUARE "foo")
Then type d. A new split window should appear with
the following details about this frame:Frame: 1 (Restartable) Locals: X: "foo" Location: File: /home/susam/foo.lisp Position: 20 Snippet: (* x x)) (square "foo")
-
While the cursor is on the same line as mentioned in the
previous point, type i to bring up the inspector
window for this frame. -
In the inspector window, type i to enter insert mode.
Enter the following variable name in insert mode:x
Then type esc to return to normal mode. Then type
enter. The following details about the variable
x
should now appear in the inspector window:#<(SIMPLE-ARRAY CHARACTER (3)) {1004617ABF}> ============================================ Dimensions: (3) Element type: CHARACTER Total size: 3 Adjustable: NIL Fill pointer: NIL Contents: 0: #f 1: #o 2: #o
-
Type enter to inspect any object under the cursor and
drill down further. -
Type p to return to the previous object.
-
Enter the regular Vim command
:q
in command-line
mode to quit the inspector window. -
Finally, move the cursor to the following line in the SLDB
window:1: [*ABORT] Return to SLIME's top level.
Then type enter to execute this restart.
Alternatively, we can enter a in normal mode to
select the abort restart to return to the previous level. At
this time, there is no command to return to SLIME’s top level.
Trace Function
Trace Function in Slimv
The following steps show how to get started with tracing functions
in Slimv:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defun square (x) (* x x)) (square (square 2))
-
Enter ,b in normal mode to evaluate the
entire buffer. -
Place the cursor on the function name, i.e., on
square
, and enter ,t in
normal mode to toggle tracing for this function. A prompt
appears to confirm the function name. Type enter to
confirm. -
While the cursor is on the last expression, enter
,d in normal mode to evaluate the top-level
form. The following output appears in the REPL buffer.(square (square 2)) 0: (SQUARE 2) 0: SQUARE returned 4 0: (SQUARE 4) 0: SQUARE returned 16 16
This output contains information about each call to the traced
function, arguments passed to it, and the return values.
Trace Function in Vlime
It takes a little more work to start tracing functions in Vlime.
The following steps show how to do it:
-
Add the following statement to
~/.vimrc
:let g:vlime_contribs = ['SWANK-ASDF', 'SWANK-PACKAGE-FU', 'SWANK-PRESENTATIONS', 'SWANK-FANCY-INSPECTOR', 'SWANK-C-P-C', 'SWANK-ARGLISTS', 'SWANK-REPL', 'SWANK-FUZZY', 'SWANK-TRACE-DIALOG']
The above variable defines the list of Swank contrib modules to
load while initializing a Vlime connection. All modules
mentioned above except the last one are loaded by default. The
SWANK-TRACE-DIALOG
module is not loaded by default
but this module is necessary for tracing functions, so in order
to load it, we define this variable to load this module in
addition to all the other modules that are loaded by default. -
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defun square (x) (* x x)) (square (square 2))
-
Save the file, connect to Vlime server, and enter
of in normal mode to compile
the entire buffer. -
Enter TD in normal mode to
show the trace dialog in a split window. -
Enter ctrl + w w
in normal mode to go back to the source code window. -
Place the cursor on the function name, i.e., on
square
, and enter
TT in normal mode to toggle
tracing for this function. -
While the cursor is on the last expression, enter
st in normal mode to evaluate
the top-level form. -
Enter ctrl + w w
in normal mode twice to go to the trace window. -
Under
Trace Entries
, place the cursor on
[refresh]
and type enter. -
Then place the cursor on
[fetch next batch]
and
type enter. Two results should appear for the two
square
calls that were made due to step 7. The trace
information would be folded under each call. -
Move the cursor to each fold line and enter
zo in normal mode to open the fold. After
opening both the folds, the following result should be visible:0 - COMMON-LISP-USER::SQUARE > 2 < 4 1 - COMMON-LISP-USER::SQUARE > 4 < 16 16
The lines starting with
>
show the arguments and
the ones starting with<
show the return values.
Nifty Features
In this section, we will go over some of the nifty features that
these plugins offer. Not all features will be covered here. I have
chosen only a few features for the discussion here that I felt would
be useful to beginners and at the same time also demonstrate the
versatility of these plugins.
Evaluate Top-Level Form
In the previous sections, we saw how to evaluate the current
expression under the cursor. In this section, we will see how to
evaluate the top-level expression around the current cursor
position. Let us do a small exercise to see this:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(+ 1 (* 2 (/ 6 2)))
-
With Slimv or Vlime connected to Swank, let us do a quick recap
of how to evaluate the current expression.With Slimv, enter the normal mode
command ,e to evaluate the current
expression.With Vlime, enter the normal mode command
ss to evaluate the current
expression.The current expression, i.e.,
(/ 6 2)
should get
evaluated and the result3
should appear in the
REPL buffer. -
Let us now see how to evaluate the top-level expression.
With Slimv, enter the normal mode
command ,d to evaluate the top-level
expression.With Vlime, enter the normal mode command
st to evaluate the top-level
expression.The top-level expression should get evaluated and the result
7
should appear in the REPL buffer.
Rainbow Parentheses
Rainbow parentheses make it easy to see matching parentheses by
colouring different levels of parentheses with different colours.
Matching parentheses have the same colour. To enable this feature
in Slimv, add this command to ~/.vimrc
:
let g:lisp_rainbow=1
This feature is not available in Vlime. But there are several Vim
plugins that support rainbow parentheses. Here are the steps to
install one such plugin that is quite popular:
git clone https://github.com/junegunn/rainbow_parentheses.vim.git ~/.vim/pack/plugins/start/rainbow_parentheses
echo 'autocmd FileType lisp,scheme,clojure RainbowParentheses' >> ~/.vimrc
In case you ever want to uninstall it, enter these commands:
rm -rf ~/.vim/pack/plugins/start/rainbow_parentheses
sed -i.bkp '/autocmd.*RainbowParentheses/d' ~/.vimrc
Argument List
You must have seen this feature already while trying out the
sections earlier. While editing a Lisp source file, after typing a
function name, as soon as a space is typed or the enter key is
typed, the argument list for the function appears to serve as a
reference. In Slimv, the argument list appears in the status line
at the bottom. In Vlime, the argument list appears in a split
window at the top.
Omni-Completion
Type a function name partially, e.g., form
, and type
tab while still in insert mode. The omni-completion menu
should appear with the list of completions if there are multiple
choices. Type ctrl+n to select the next choice
and ctrl+p to select the previous choice.
Selecting a choice also immediately inserts that choice in the
buffer. This works in both Slimv and Vlime. In Slimv, we can also
type tab to select the next choice.
By default, omni-completion is fuzzy. For example,
type wl
and type tab and omni-complete
should insert write-line
automatically as well as show
other matching choices.
Describe Symbol
With Slimv, enter the normal mode command ,s
to describe the symbol under the cursor. This brings up the
documentation of the symbol in the Vim message area. This feature
works while editing Common Lisp and Clojure source files but not
while editing Scheme source file. This feature is not supported for
Scheme at this time. See
the Other Lisp Dialects
part for particulars on how one can arrange Slimv with Clojure and MIT/GNU
Scheme.
With Vlime, enter da in regular
mode to explain the image below the cursor. This brings up the
documentation of the image in a break up window.
Develop Macro
Here is an excercise that shows how to expand macros interactively
while editing a Lisp source file:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defmacro calc (a op b) (list op a b)) (defmacro square (x) (list 'calc x '* x)) (square 2)
-
With Slimv, enter ,b in normal mode to
evaluate the entire buffer.With Vlime, save the file, connect to Vlime server, and type
of in normal mode to compile the
entire buffer. -
With Slimv, while the cursor is on the last expression, enter
,1 in normal mode to expand the macro form
once.With Vlime, enter m1 in normal
mode to do the same thing.The following expansion should appear as the result:
(CALC 2 * 2)
Slimv displays the expansion in the REPL buffer whereas Vlime
displays it in a new split window. -
With Slimv, enter ,m in normal mode to
recursively expand the current expression until it is no longer
a macro.With Vlime, enter ma in normal
mode to do the same thing.The following expansion should appear as the result:
(* 2 2)
Cross Reference
Here is an exercise that shows how to use the cross-reference
commands in Slimv and Vlime:
-
Create a file with Vim, say
foo.lisp
and enter the
following code into it:(defun square (x) (* x x)) (defun square-of-sum (x y) (square (+ x y))) (defun sum-of-squares (x y) (+ (square x) (square y))) (square-of-sum 2 3) (sum-of-squares 2 3)
-
With Slimv, enter ,b in normal mode to
evaluate the entire buffer.With Vlime, save the file, connect to Vlime server, and type
of in normal mode to compile the
entire buffer. -
With Slimv, place the cursor on any occurrence of the symbol
square
and enter
,xl in normal mode. A prompt
would appear to confirm the symbol name. Type enter
to confirm. The list of all callers should now appear in the
REPL buffer.With Vlime, place the cursor on any occurrence of the symbol
square
and enter xc
in normal mode to list all callers of the function. The output
appears in a split window containing the cross reference (xref)
buffer. Type enter on any item in the xref buffer and
Vlime will take you directly to the referenced location.
Other Common Lisp Implementations
The previous sections used SBCL as the implementation of Common
Lisp. How well do Slimv and Vlime work with other Common Lisp
implementations?
I have found that both plugins are pretty well tested with SBCL.
However, they may not be so well tested with other implementations.
Due to the lack of sufficient testing with Common Lisp
implementations other than SBCL, certain errors may occur while
using other implementations. Sometimes it is possible to work
around these errors and sometimes it isn’t. We will see an example
of this in an upcoming section when we try to start Swank server
automatically using Vlime and CLISP.
For this section, I choose CLISP and Embeddable Common-Lisp (ECL) as
two other implementations of Common Lisp that will be used with
Slimv and Vlime. After following the upcoming subsections, you
should get the hang of how to make Slimv or Vlime work with other
implementations of Common Lisp.
Use Slimv with CLISP
If you have read and tried the steps in the
Get Started with
Slimv and SBCL part, it will be fairly straightforward to make use of
Slimv with CLISP. The steps are comparable with a couple of minor
modifications. They’re defined beneath:
-
Uninstall SBCL and set up CLISP with these instructions:
sudo apt-get take away sbcl sudo apt-get set up clisp
-
To start out Swank server manually, enter this command:
clisp ~/.vim/pack/plugins/begin/slimv/slime/start-swank.lisp
Then edit a Lisp supply file and enter the traditional command
,c to hook up with it and convey up the REPL
window. -
To start out Swank robotically from Slimv, there’s nothing extra
to be executed. Simply edit a Lisp supply file and enter the traditional
mode command ,c. Whereas operating in GNU
Display, tmux, or a desktop setting, Slimv can robotically
detect CLISP and begin Swank server with it.
On the whole, to begin Swank server manually with one other Widespread Lisp
implementation, we have to determine how one can load
start-swank.lisp
with it.
Use Slimv with ECL
The steps to use Slimv with Embeddable Common-Lisp (ECL) are very
similar too. Once again, only if we need to start Swank server
manually, we need to figure out the command to do so. Otherwise,
there is no other difference. Here are the steps:
-
Ensure that SBCL and CLISP are uninstalled and ECL is installed.
sudo apt-get remove sbcl clisp sudo apt-get install ecl
-
To start Swank server manually, enter this command:
ecl --load ~/.vim/pack/plugins/start/slimv/slime/start-swank.lisp
Then edit a Lisp source file and enter the normal command
,c to connect to it and bring up the REPL
window. -
To start Swank automatically from Slimv, there is nothing more
to be done. Just edit a Lisp source file and enter the normal
mode command ,c. While running in GNU
Screen, tmux, or a desktop environment, Slimv can automatically
detect CLISP and start Swank server with it.There is a possible timeout issue to be aware of though. ECL
can take a minute or two to compile the code it loads the first
time Swank server is started. However, Slimv has a default
timeout period of 20 seconds, so Slimv may fail with the
following error message:SWANK server is not running. Press ENTER to continue.
If this happens, just wait for ECL to complete compiling Swank
server. Once it starts Swank server, enter the normal mode
command ,c again and it should connect
immediately.
Use Vlime with CLISP
This subsection assumes that you have already read and tried the
Get Started with
Vlime and SBCL part, so you might be acquainted with Vlime
fundamentals. Now we are going to see what extra it takes to make use of Vlime with CLISP
within the steps beneath:
-
Allow us to assume we need to begin afresh with CLISP, i.e., we do
not have earlier artifacts created by SBCL. To wash up outdated
artifacts, enter these instructions:rm -rf ~/.sbclrc ~/quicklisp sudo apt-get take away sbcl
-
Set up CLISP with this command:
sudo apt-get set up clisp
-
Set up Quicklisp utilizing CLISP with these instructions:
curl -O https://beta.quicklisp.org/quicklisp.lisp clisp -i quicklisp.lisp -x '(quicklisp-quickstart:set up)' clisp -i ~/quicklisp/setup.lisp -x '(ql:add-to-init-file)'
Kind enter in the long run, when prompted, to finish the
set up. -
Add the next code to
~/.vimrc
:let g:vlime_cl_impl="clisp" operate! VlimeBuildServerCommandFor_clisp(vlime_loader, vlime_eval) return ['clisp', '-i', a:vlime_loader, '-x', a:vlime_eval, '-repl'] endfunction
In contrast to Slimv, automated begin of Swank server with Widespread Lisp
implementations apart from SBCL will not be supported out of the
field, so the above Vim script tells Vlime how one can begin Swank
server with CLISP. The-repl
choice is used to
work round a difficulty that’s defined within the subsequent level. -
Vlime is now prepared for use with CLISP. Simply edit a Lisp
supply file and enter the traditional mode command
rr to begin Swank server and
connect with it robotically.You might even see the next error within the SLIME debugger (`sldb`)
break up window:SOCKET-STATUS on #1=#<INPUT STRING-INPUT-STREAM> is unlawful
Regardless of the above error, the next message ought to seem at
the underside:Vlime Connection 1 established.
If the above message happens, you possibly can ignore this error, shut
the debugger window in addition to the console output window, and
proceed to make use of Vlime usually.The
-repl
choice used within the earlier step ensures
that the REPL begins regardless of this error. With out it, this step
wouldn’t have succeeded. That is what I meant once I mentioned
earlier that we could have to work round sure errors whereas
utilizing these plugins with a Widespread Lisp implementation apart from
SBCL.
Use Vlime with ECL
Here are the steps to use Vlime with ECL:
-
Let us assume we want to start afresh with ECL, i.e., we do not
have previous artifacts created by SBCL or ECL. To clean up old
artifacts, enter these commands:rm -rf ~/.sbclrc ~/.clisprc.lisp ~/quicklisp sudo apt-get remove sbcl clisp
-
Install ECL with this command:
sudo apt-get install ecl
-
Install Quicklisp using ECL with these commands:
curl -O https://beta.quicklisp.org/quicklisp.lisp ecl --load quicklisp.lisp --eval '(quicklisp-quickstart:install)' --eval '(quit)' ecl --load ~/quicklisp/setup.lisp --eval '(ql:add-to-init-file)' --eval '(quit)'
Type enter in the end, when prompted, to complete the
installation. -
Add the following code to
~/.vimrc
:let g:vlime_cl_impl="ecl" function! VlimeBuildServerCommandFor_ecl(vlime_loader, vlime_eval) return ['ecl', '--load', a:vlime_loader, '--eval', a:vlime_eval] endfunction
-
Edit a Lisp source file and enter the normal mode command
rr to start Swank server and
connect to it automatically.
Other Lisp Dialects
So far, we have seen how to use Slimv or Vlime with a Common Lisp
implementation. Now let us see how well these plugins work with
other Lisp dialects. Vlime does not support other Lisp dialects.
It supports Common Lisp only. Slimv supports two other popular
dialects of Lisp: Scheme and Clojure. In the next two subsections,
we see how
Use Slimv with MIT/GNU Scheme
Slimv is documented to work with MIT/GNU Scheme on Linux only.
Enter
:help slimv-installation
in Vim to read more about it.
It says the following under the “Prerequisites” section.
Lisp or Clojure or MIT/GNU Scheme (Linux only) installed.
Further, the Swank loader script for MIT/GNU Scheme named
swank-mit-scheme.scm
says the following in its source code
comments:
You need MIT/GNU Scheme 9.2
At the time of writing this article, I have confirmed that both
these requirements indeed need to be met to use Slimv with MIT/GNU
Scheme. Here are the steps to use Slimv with MIT/GNU Scheme:
-
Install MIT/GNU Scheme with this command:
sudo apt-get mit-scheme
Ensure that
vim-nox
, tmux, and Slimv are installed
as explained in
the Get Started
with Slimv and SBCL subsection earlier. -
That is an optionally available step. To start out Swank server robotically
from Slimv, run Vim in tmux, GNU Display, or a desktop
setting. On this article, we use tmux, so begin tmux with
this command:tmux
-
This step is important solely in case you are not utilizing tmux, GNU
Display, or a desktop setting. In such a case, enter this
command to begin Swank server manually:scheme --load ~/.vim/pack/plugins/begin/slimv/slime/contrib/swank-mit-scheme.scm
-
Create a brand new Scheme supply code file, say,
foo.scm
with this command:vim foo.scm
-
To hook up with Swank server, enter the next command in Vim
regular mode:,c
-
Kind some code into the buffer for the brand new file. To take action,
first kind i to enter insert mode and sort this code:(show "howdy, worldn")
Kind esc to return to regular mode. To guage, the
present expression below the cursor, enter the next command
in regular mode:,e
Each the present expression and its consequence ought to seem within the
REPL window.
I’ve confirmed that the steps above work high-quality with MIT/GNU Scheme
9.1.1 on Debian GNU/Linux 9.11 (stretch). Like I discussed earlier than,
Slimv requires Linux to work with MIT/GNU Scheme. For instance,
attempting to begin Swank server with MIT/GNU Scheme 9.2 on macOS Excessive
Sierra 10.13.6 fails with this error:
; /usr/native/Cellar/mit-scheme/9.2_2/lib/mit-scheme-c/embrace/config.h:879:10: deadly error: 'sys/sorts.h' file not discovered
Additional, the model of MIT/GNU Scheme actually must be 9.x. For
instance, when I attempt to begin Swank with MIT/GNU Scheme 10.1.5 on
Debian GNU/Linux 10.1 (buster), the next error happens:
;The thing #[package 12 (user)], handed as an argument to ->setting, shouldn't be an setting.
Use Slimv with Clojure
Slimv works fine with Clojure too. However, it may have some
trouble locating Clojure on the system if we attempt to start Swank
server automatically with Clojure. That is because where and how
Clojure is installed varies from operating system to operating
system and also depends on the installation procedure chosen to set
up Clojure.
On Unix-like systems, Slimv looks for JAR files that match the glob
pattern clojure*.jar
at paths that match the glob
pattern /usr/local/bin/*clojure*
and ~/*clojure
, in that order. On Windows, it looks
for the JAR files at directory paths that match the glob
pattern C:*clojure*
and C:*clojure*lib
.
Additionally, Slimv also looks for the JAR files at the paths
mentioned in the PATH
environment variable. There are
a few more strategies too to locate Clojure but we will not get into
that here.
In this section, I will show how to build Clojure from source with
Maven and install it at ~/clojure/clojure.jar
, a path
Slimv can easily find, so installing it here would mean that the
steps below would work everywhere regardless of the operating
system. If you are on Windows, install Clojure
at C:clojureclojure.jar
instead.
Here are the steps to install Clojure at
~/clojure/clojure.jar
and use it with Slimv:
-
Choose one of the two sets of commands below to install Maven:
# On Debian, Ubuntu, etc. sudo apt-get install maven # On macOS brew install openjdk maven export JAVA_HOME=/usr/local/opt/openjdk export PATH="$JAVA_HOME/bin:$PATH"
-
Enter these commands to install Clojure:
git clone https://github.com/clojure/clojure.git ~/clojure git -C ~/clojure checkout clojure-1.10.1 mvn -f ~/clojure/pom.xml -Plocal -Dmaven.test.skip=true package
-
Ensure that
vim-nox
, tmux, and Slimv are installed
as explained in
the Get Started
with Slimv and SBCL subsection earlier. -
That is an optionally available step. To start out Swank server robotically
from Slimv, run Vim in tmux, GNU Display, or a desktop
setting. On this article, we use tmux, so begin tmux with
this command:tmux
-
This step is important solely in case you are not utilizing tmux, GNU
Display, or a desktop setting. In such a case, enter these
instructions to begin Swank server manually:SWANK_DIR=~/.vim/pack/plugins/begin/slimv/swank-clojure java -cp "$HOME/clojure/clojure.jar:$SWANK_DIR" clojure.essential -i "$SWANK_DIR/swank/swank.clj" -e '(swank.swank/start-repl)' -r
-
Create a brand new Clojure supply code file, say,
foo.clj
with this command:vim foo.clj
-
To hook up with Swank server, enter the next command in Vim
regular mode:,c
-
Kind some code into the buffer for the brand new file. To take action,
first kind i to enter insert mode and sort this code:(println "howdy, world")
Kind esc to return to regular mode. To guage, the
present expression below the cursor, enter the next command
in regular mode:,e
Each the present expression and its consequence ought to seem within the
REPL window.
Comparability of Slimv and Vlime
Finally, let me provide a comparison of both Slimv and Vlime side by
side. This comparison table below is not exhaustive. There are
more differences between the tools than what is mentioned below.
Slimv | Vlime |
---|---|
Slimv’s directory structure conforms to the directory |
Vlime’s directory structure does not conform to the |
Slimv requires a Vim package that is compiled with support |
Vlime does not have this requirement. It can work with |
Slimv requires Vim to be running within tmux, GNU Screen, or |
Vlime does not require tmux, GNU Screen, or a desktop |
Slimv does not require Quicklisp to install Swank. Slimv |
Vlime requires Quicklisp to be installed. It relies on |
Slimv bundles Paredit with itself. Installing Slimv also |
Vlime does not bundle Paredit with itself. Paredit needs to |
The buffer for REPL is interactive in Slimv. We can type |
The buffer for REPL is not interactive in Vlime. Its |
Paredit electric returns work fine with Slimv. Slimv remaps |
Paredit electric returns do not work fine with Vlime. Vlime |
Slimv shows argument list of a function, symbol description, |
Vlime shows argument list of a function, symbol description, |
Slimv shows trace results, macro expansion, cross reference, |
Vlime shows resultions of trace results, macro expansion, |
Slimv supports programming in Common Lisp, MIT/GNU Scheme, |
Vlime supports programming in Common Lisp only. It does not |
Slimv supports rainbow parentheses by adding |
Vlime does not have rainbow parentheses. However, this is |
Slimv cross-reference commands do not help us to jump |
Vlime cross-reference commands create a xref buffer that |
Quick Recommendation
If you are looking for a quick recommendation on which plugin to
use, I am going to recommend Slimv. It has been around for much
longer. It supports a wider variety of Lisp implementations. I
find its default key bindings more convenient. A truly interactive
REPL buffer is also a bonus. Also, Slimv supports Scheme and
Clojure whereas Vlime does not. Having said that, I think it is a
good idea to try out both the plugins on your own and then find out
which one suits you more.