CIDER jack-in to Clojure CLI projects from Spacemacs
Running a Clojure project created with CLI tools or clj-new
may require you to pass in an alias for the REPL to pick up the right libraries.
A few days ago I created a new ClojureScript and reagent project, using the Clojure CLI tools and clj-new
project creation tool, which converts Leiningen and Boot templates into a deps.edn based project. Unfortunately when I created a project from the fighwheel-main template the REPL failed to run from CIDER using cider-jack-in-cljs
, saying that figwheel-main was not found. All that was required was to specify the :fig
alias when running a REPL.
This article covers two approaches to running Clojure CLI projects from CIDER jack-in that require setting of an alias or multiple aliases e.g. -A:fig:build:party:hammock
Clojure CLI and tools.deps
Clojure Command Line Interface (CLI) tools provide a fast way for developers to get started with Clojure and simplify an already pretty simple experience. With tools.deps it also provides a more flexible approach to including libraries, including the use of code from a specific commit in a Git repository.
Newer content can be found in Using Clojure tools section of Practicalli Clojure
Practicalli Clojure 35 - Clojure CLI tools - an introduction is a video of a live broadcast of this content (inclucing typos)
Continue reading →Testing Klipse Integration
A simple article to test the klipse integration
Lets do some simple Clojure code
Continue reading →YASnippets for faster clojure coding
Yasnippets minimise typing for commonly used Clojure forms and documentation structures, or any other text regularly created. Yasnippets have placeholders that allow jumping (tabbing) to points in the snippet, so specific text can be added to the more generic text of the snippet.
Emacs YASnippet package uses mode-specific snippets that expand to anything from a simple text replacement to an intricate code block structure using placeholders to add specific values to the general form.
See YASnippet in action in this Emacs Yasnippet video.
Continue reading →Writing custom snippets for yasnippet
Snippets are names that expand to code or documentation, to minimise typing commonly used code pattern and can serve as a reminder of common Clojure forms.
YASnippets templates are defined in plain text, so are very easy to learn and write.
The content of a snippet can be anything, from a simple piece of text or a more involved code structure with placeholders for tab stops. Snippets can even include Emacs lisp (elisp) code which is evaluated, allowing the snippet to tap into all the features of Emacs.
Continue reading →