1
0
Fork 0
cl-sites/lispcookbook.github.io/cl-cookbook/editor-support.html
2023-10-25 11:23:21 +02:00

399 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.2.0">
<title>Editor support</title>
<meta charset="utf-8">
<meta name="description" content="A collection of examples of using Common Lisp">
<meta name="viewport" content=
"width=device-width, initial-scale=1">
<link rel="icon" href=
"assets/cl-logo-blue.png"/>
<link rel="stylesheet" href=
"assets/style.css">
<script type="text/javascript" src=
"assets/highlight-lisp.js">
</script>
<script type="text/javascript" src=
"assets/jquery-3.2.1.min.js">
</script>
<script type="text/javascript" src=
"assets/jquery.toc/jquery.toc.min.js">
</script>
<script type="text/javascript" src=
"assets/toggle-toc.js">
</script>
<link rel="stylesheet" href=
"assets/github.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<h1 id="title-xs"><a href="index.html">The Common Lisp Cookbook</a> &ndash; Editor support</h1>
<div id="logo-container">
<a href="index.html">
<img id="logo" src="assets/cl-logo-blue.png"/>
</a>
<div id="searchform-container">
<form onsubmit="duckSearch()" action="javascript:void(0)">
<input id="searchField" type="text" value="" placeholder="Search...">
</form>
</div>
<div id="toc-container" class="toc-close">
<div id="toc-title">Table of Contents</div>
<ul id="toc" class="list-unstyled"></ul>
</div>
</div>
<div id="content-container">
<h1 id="title-non-xs"><a href="index.html">The Common Lisp Cookbook</a> &ndash; Editor support</h1>
<!-- Announcement we can keep for 1 month or more. I remove it and re-add it from time to time. -->
<p class="announce">
📹 💻
<a style="font-size: 120%" href="https://www.udemy.com/course/common-lisp-programming/?couponCode=LISPMACROSPOWER" title="This course is under a paywall on the Udemy platform. Several videos are freely available so you can judge before diving in. vindarel is (I am) the main contributor to this Cookbook."> Discover vindarel's Lisp course in videos with this September coupon.</a>
<strong>
Recently added: 18 videos on MACROS.
</strong>
<a style="font-size: 90%" href="https://github.com/vindarel/common-lisp-course-in-videos/">Learn more</a>.
</p>
<p class="announce-neutral">
📕 <a href="index.html#download-in-epub">Get the EPUB and PDF</a>
</p>
<div id="content"
<p>The editor of choice is still <a href="https://www.gnu.org/software/emacs/">Emacs</a>, but it is not the only one.</p>
<h2 id="emacs">Emacs</h2>
<p><a href="https://github.com/slime/slime/">SLIME</a> is the Superior Lisp
Interaction Mode for Emacs. It has support for interacting with a
running Common Lisp process for compilation, debugging, documentation
lookup, cross-references, and so on. It works with many implementations.</p>
<p><a href="https://shinmera.github.io/portacle/">Portacle</a> is a portable and
multi-platform Common Lisp environment. It ships Emacs, SBCL,
Quicklisp, SLIME and Git.</p>
<p><img src="assets/portacle.png" style="width: 800px" alt="Portacle with an open Slime REPL" /></p>
<h3 id="installing-slime">Installing SLIME</h3>
<p>SLIME is in the official GNU ELPA repository of Emacs Lisp packages
(in Emacs24 and forward). Install with:</p>
<pre><code>M-x package-install RET slime RET
</code></pre>
<p>Since SLIME is heavily modular and the defaults only do the bare minimum (not
even the SLIME REPL), you might want to enable more features with</p>
<pre><code class="language-lisp">(slime-setup '(slime-fancy slime-quicklisp slime-asdf))
</code></pre>
<p>For more details, consult the
<a href="https://common-lisp.net/project/slime/doc/html/">documentation</a> (also available
as an Info page).</p>
<p>Now you can run SLIME with <code>M-x slime</code> and/or <code>M-x slime-connect</code>.</p>
<p>See also:</p>
<ul>
<li><a href="https://wikemacs.org/wiki/SLIME">https://wikemacs.org/wiki/SLIME</a> - configuration examples and extensions.</li>
</ul>
<h3 id="using-emacs-as-an-ide">Using Emacs as an IDE</h3>
<p>See <a href="emacs-ide.html">“Using Emacs as an IDE”</a>.</p>
<h2 id="vim--neovim">Vim &amp; Neovim</h2>
<p><a href="https://github.com/kovisoft/slimv">Slimv</a> is a full-blown
environment for Common Lisp inside of Vim.</p>
<p><a href="https://github.com/vlime/vlime">Vlime</a> is a Common Lisp dev
environment for Vim (and Neovim), similar to SLIME for Emacs and SLIMV
for Vim.</p>
<p><img src="assets/slimv.jpg" style="width: 800px" alt="The Slimv plugin with an open REPL" /></p>
<p><a href="https://github.com/adolenc/cl-neovim/">cl-neovim</a> makes it possible to write
Neovim plugins in Common Lisp.</p>
<p><a href="https://gitlab.com/HiPhish/quicklisp.nvim">quicklisp.nvim</a> is a Neovim
frontend for Quicklisp.</p>
<p><a href="https://github.com/justin2004/slimv_box">Slimv_box</a> brings Vim, SBCL, ABCL,
and tmux in a Docker container for a quick installation.</p>
<p>See also:</p>
<ul>
<li><a href="https://susam.net/blog/lisp-in-vim.html">Lisp in Vim</a> demonstrates usage and
compares both Slimv and Vlime</li>
</ul>
<h2 id="pulsar-ex-atom">Pulsar (ex Atom)</h2>
<p>See <a href="https://github.com/neil-lindquist/slima">SLIMA</a>. This package
allows you to interactively develop Common Lisp code, turning Atom, or
now <a href="https://github.com/pulsar-edit/pulsar">Pulsar</a>, into a pretty
good Lisp IDE. It features:</p>
<ul>
<li>REPL</li>
<li>integrated debugger
<ul>
<li>(not a stepping debugger yet)</li>
</ul>
</li>
<li>jump to definition</li>
<li>autocomplete suggestions based on your code</li>
<li>compile this function, compile this file</li>
<li>function arguments order</li>
<li>integrated profiler</li>
<li>interactive object inspection.</li>
</ul>
<p>It is based on the Swank backend, like Slime for Emacs.</p>
<p><img src="assets/atom-slime.png" style="width: 800px" alt="The SLIMA extension for Atom with an open Lisp REPL" /></p>
<h2 id="vscode">VSCode</h2>
<p><a href="https://marketplace.visualstudio.com/items?itemName=rheller.alive">Alive</a> makes
VSCode a powerful Common Lisp development. It hooks directly into the Swank
server that Emacs Slime uses and is fully compatible with VSCodes ability to
develop remotely in containers, WSL, Remote machines, etc. It has no
dependencies beyond a version of Common Lisp on which to run the Swank server.
It can be configured to run with Quicklisp, CLPM, and Roswell. It currently
supports:</p>
<ul>
<li>Syntax highlighting</li>
<li>Code completion</li>
<li>Code formatter</li>
<li>Jump to definition</li>
<li>Snippets</li>
<li>REPL integration</li>
<li>Interactive Debugger</li>
<li>REPL history</li>
<li>Inline evaluation</li>
<li>Macro expand</li>
<li>Disassemble</li>
<li>Inspector</li>
<li>Hover Text</li>
<li>Rename function args and let bindings</li>
<li>Code folding</li>
</ul>
<p><img src="assets/commonlisp-vscode-alive.png" style="width: 800px" alt="The Alive VSCode plugin showing the interactive debugger." /></p>
<p><a href="https://marketplace.visualstudio.com/items?itemName=ailisp.commonlisp-vscode">commonlisp-vscode
extension</a>
works via the <a href="https://github.com/ailisp/cl-lsp">cl-lsp</a> language server and
its possible to write LSP client that works in other editors. It depends
heavily on <a href="https://roswell.github.io/Home.html">Roswell</a>. It currently
supports:</p>
<ul>
<li>running a REPL</li>
<li>evaluate code</li>
<li>auto indent,</li>
<li>code completion</li>
<li>go to definition</li>
<li>documentation on hover</li>
</ul>
<p><img src="assets/commonlisp-vscode.png" style="width: 800px" alt="The VSCode extension with a Lisp REPL, code completion and a mini-map." /></p>
<h3 id="using-vscode-with-alive">Using VSCode with Alive</h3>
<p>See <a href="vscode-alive.html">Using VSCode with Alive</a>.</p>
<h2 id="jetbrains---new-in-jan-2023">JetBrains - NEW in Jan, 2023!</h2>
<p><a href="https://github.com/Enerccio/SLT">SLT</a> is a new (published on January,
2023) plugin for the suite of JetBrains IDEs. It uses a modified SLIME/Swank
protocol to commmunicate with SBCL, providing IDE capabilities for
Common Lisp.</p>
<p>It has a very good <a href="https://github.com/Enerccio/SLT/wiki/User-Guide">user guide</a>.</p>
<p>At the time of writing, for its version 0.4, it supports:</p>
<ul>
<li>REPL</li>
<li>symbol completion</li>
<li>send expressions to the REPL</li>
<li>interactive debugging, breakpoints</li>
<li>documentation display</li>
<li>cross-references</li>
<li>find symbol by name, global class/symbol search</li>
<li>inspector (read-only)</li>
<li>graphical threads list</li>
<li>SDK support, automatic download for Windows users</li>
<li>multiple implementations support: SBCL, CCL, ABCL and AllegroCL.</li>
</ul>
<p><img src="assets/jetbrains-slt.png" style="width: 800px" alt="SLT, a good Common Lisp plugin for JetBrains IDEs." /></p>
<h2 id="eclipse">Eclipse</h2>
<p><a href="https://github.com/Ragnaroek/dandelion">Dandelion</a> is a plugin for the
Eclipse IDE.</p>
<p>Available for Windows, Mac and Linux, built-in SBCL and CLISP support
and possibility to connect other environments, interactive debugger
with restarts, macro-expansion, parenthesis matching,…</p>
<p><img src="dandelion.png" style="width: 800px" alt="Dandelion, a simple Common Lisp plugin for Eclipse" /></p>
<h2 id="lem">Lem</h2>
<p><a href="https://github.com/lem-project/lem/">Lem</a> is an editor tailored for Common Lisp development. Once you
install it, you can start developing. Its interface resembles Emacs
and SLIME (same shortcuts). It comes with an ncurses and an SDL2
frontend, and other programming modes thanks to its built-in LSP client:
Python, Go, Rust, JS, Nim, Scheme, HTML, CSS, plus a directory mode, a <strong>vim layer</strong>, and more.</p>
<p><img src="assets/lem-sdl2.png" style="width: 800px" alt="Lem running in a SDL2 GUI." /></p>
<p>It can be started as a REPL right away in the terminal. Run it with:</p>
<pre><code>lem --eval "(lem-lisp-mode:start-lisp-repl t)"
</code></pre>
<p>So you probably want a shell alias:</p>
<pre><code>alias ilem='lem --eval "(lem-lisp-mode:start-lisp-repl t)"'
</code></pre>
<p><img src="assets/lem1.png" style="width: 800px" title="Lem's REPL" alt="Lem running in the terminal with the Lisp REPL full screen, showing a completion window." /></p>
<h2 id="sublime-text">Sublime Text</h2>
<p><a href="http://www.sublimetext.com/3">Sublime Text</a> has now good support for
Common Lisp.</p>
<p>First install the “SublimeREPL” package and then see the options
in Tools/SublimeREPL to choose your CL implementation.</p>
<p>Then <a href="https://github.com/s-clerc/slyblime">Slyblime</a> ships IDE-like
features to interact with the running Lisp image. It is an
implementation of SLY and it uses the same backend (SLYNK). It
provides advanced features including a debugger with stack frame
inspection.</p>
<p><img src="assets/editor-sublime.png" style="width: 800px" alt="A Lisp REPL in Sublime Text" /></p>
<h2 id="lispworks-proprietary">LispWorks (proprietary)</h2>
<p><a href="http://www.lispworks.com/">LispWorks</a> is a Common Lisp implementation that
comes with its own Integrated Development Environment (IDE) and its share of
unique features, such as the CAPI GUI toolkit. It is <strong>proprietary</strong> and
provides a <strong>free limited version</strong>.</p>
<p>You can <a href="lispworks.html">read our LispWorks review here</a>.</p>
<p><img src="assets/lispworks/two-sided-view.png" style="width: 800px" title="The LispWorks IDE" alt="The LispWorks listener and the editor in the Mate desktop environment" /></p>
<h2 id="geany-experimental">Geany (experimental)</h2>
<p><a href="https://github.com/jasom/geany-lisp">Geany-lisp</a> is an experimental
lisp mode for the <a href="https://geany.org/">Geany</a> editor. It features completion of symbols,
smart indenting, jump to definition, compilation of the current file and
highlighting of errors and warnings, a REPL, and a project skeleton creator.</p>
<p><img src="assets/geany.png" style="width: 800px" alt="The Geany Lisp plugin showing compilation warnings" /></p>
<h2 id="notebooks">Notebooks</h2>
<p><a href="https://github.com/yitzchak/common-lisp-jupyter">common-lisp-jupyter</a> is a Common Lisp
kernel for Jupyter notebooks.</p>
<p>You can <a href="https://nbviewer.jupyter.org/github/yitzchak/common-lisp-jupyter/blob/master/examples/about.ipynb">see a live Jupyter notebook written in Lisp here</a>. It is easy to install (Roswell, repo2docker and Docker recipes).</p>
<p><img src="assets/jupyterpreview.png" style="width: 800px" alt="A Jupyter notebook running a Common Lisp kernel, exploring the Lorentz system of differential equations, showing a colorful 3D plot with interactive controls (note: the code in the screenshot is actually not Lisp!)" /></p>
<p>There is also <a href="https://github.com/tamamu/darkmatter">Darkmatter</a>, a notebook-style
Common Lisp environment, built in Common Lisp.</p>
<h2 id="repls">REPLs</h2>
<p><a href="https://github.com/koji-kojiro/cl-repl">cl-repl</a> is an ipython-like REPL. It supports symbol completion, magic and shell commands, editing command in a file and a simple debugger.</p>
<p>You might also like <a href="https://github.com/hellerve/sbcli">sbcli</a>, an even simpler REPL with readline capabilities. It handles errors gracefully instead of showing a debugger.</p>
<p><img src="assets/cl-repl.png" style="width: 500px" alt="cl-repl 0.4.1 runnning in the terminal, built with Roswell, featuring multi-line prompts and syntax highlighting." /></p>
<h2 id="others">Others</h2>
<p>There are some more editors out there, more or less discontinued, and
free versions of other Lisp vendors, such as Allegro CL.</p>
<p class="page-source">
Page source: <a href="https://github.com/LispCookbook/cl-cookbook/blob/master/editor-support.md">editor-support.md</a>
</p>
</div>
<script type="text/javascript">
// Don't write the TOC on the index.
if (window.location.pathname != "/cl-cookbook/") {
$("#toc").toc({
content: "#content", // will ignore the first h1 with the site+page title.
headings: "h1,h2,h3,h4"});
}
$("#two-cols + ul").css({
"column-count": "2",
});
$("#contributors + ul").css({
"column-count": "4",
});
</script>
<div>
<footer class="footer">
<hr/>
&copy; 2002&ndash;2023 the Common Lisp Cookbook Project
<div>
📹 Discover <a style="color: darkgrey; text-decoration: underline", href="https://www.udemy.com/course/common-lisp-programming/?referralCode=2F3D698BBC4326F94358">vindarel's Lisp course on Udemy</a>
</div>
</footer>
</div>
<div id="toc-btn">T<br>O<br>C</div>
</div>
<script text="javascript">
HighlightLisp.highlight_auto({className: null});
</script>
<script type="text/javascript">
function duckSearch() {
var searchField = document.getElementById("searchField");
if (searchField && searchField.value) {
var query = escape("site:lispcookbook.github.io/cl-cookbook/ " + searchField.value);
window.location.href = "https://duckduckgo.com/?kj=b2&kf=-1&ko=1&q=" + query;
// https://duckduckgo.com/params
// kj=b2: blue header in results page
// kf=-1: no favicons
}
}
</script>
<script async defer data-domain="lispcookbook.github.io/cl-cookbook" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>