Introduction to Conjure
Conjure is a dynamic interactive development tool for Neovim that bridges your code and a live REPL (Read-Eval-Print Loop). Designed for Lisp dialects like Clojure, it enables:
- Inline code evaluation (forms, functions, buffers)
- REPL integration (Clojure, ClojureScript, Babashka)
- Test execution (namespace/current form/all tests)
- Result inspection in dedicated log buffers
Your LunarVim configuration optimizes Conjure for speed, with Space as leader and , as local leader, creating a fluid Clojure-centric workflow.
Your Conjure Setup
Core Configuration
vim.g["conjure#log#botright"] = true -- Logs appear at bottom
vim.g["conjure#log#wrap"] = true -- Readable wrapped text
vim.g["conjure#log#on_eval"] = true -- Auto-show logs on eval
vim.g["conjure#mapping#prefix"] = "<leader>j" -- Space + j prefix This creates a clean, non-intrusive evaluation experience.
Keybindings & Workflows
All commands start with Space + j followed by a key:
1. Evaluation
| Key | Action | Command Sequence | Use Case |
|---|---|---|---|
e | Eval current form | Space + j + e | Evaluate function under cursor |
r | Eval root form | Space + j + r | Eval top-level form |
m | Eval marked form | Space + j + m | Eval visual selection |
b | Eval buffer | Space + j + b | Reload entire file |
Example:
(defn sum [a b]
(+ a b)) - Place cursor inside
(+ a b), pressSpace + j + e→ Evaluates the addition. - Place cursor inside
sum, pressSpace + j + r→ Evaluates entiredefn.
2. Log Management
| Key | Action |
|---|---|
l | Toggle log split |
c | Close visible logs |
Pro Tip: Use Enter on log results to jump to their source!
3. Testing
| Key | Action | Command Sequence |
|---|---|---|
t c | Test current form | Space + j + t c |
t n | Test current namespace | Space + j + t n |
t a | Test all | Space + j + t a |
t l | Test last | Space + j + t l |
Workflow:
- Write a test:
(deftest sum-test (is (= 3 (sum 1 2)))) Space + j + t c→ Runs this test.Space + j + t a→ Runs all project tests.
4. REPL Connection
| Key | Action |
|---|---|
j | Start REPL (Jack-in) |
Press Space + j + j to launch a REPL session. Conjure auto-detects Lein, Clj, Babashka, or deps.edn projects.
Advanced Configuration Tips
1. Result Inspection
Add this to your config to keep logs persistent:
vim.g["conjure#log#hud#enabled"] = false -- Disable HUD for full log buffer 2. Custom REPL Commands
Use , (local leader) in log buffers to:
,repl/enter: Switch to REPL buffer,repl/previous: Cycle REPL history
Troubleshooting
- No evaluation results? Ensure REPL is active (
Space + j + j). - Keybindings not working? Verify
conjure#mapping#prefixis set correctly. - Logs too verbose? Use
Space + j + cto clear them.
Integration with LunarVim
- File Explorer: Keep
neo-tree(Space + e) open for project navigation. - Structural Editing: Pair with
nvim-paredit(previous setup) for precise s-expression manipulation. - Git: Use LunarVim’s git integration (
Space + g m) to track changes.
Example Workflow
- Start REPL:
Space + j + j - Edit Code:
(defn greet [name] (str "Hello, " name)) - Evaluate:
Space + j + b→ Reload buffer. - Test:
(deftest greet-test (is (= "Hello, Alice" (greet "Alice"))))Space + j + t c→ Validate test.
- Inspect: Press
Enteron test results in log to jump back.
Conclusion
With your Conjure configuration in LunarVim, you’ve created a REPL-powered Clojure IDE that:
- Makes code experimentation immediate (
Space + j + e) - Simplifies test-driven development (
Space + j + t n/a/c) - Keeps results organized (
Space + j + l/c)
By leveraging your Space leader and logical key groupings, you minimize context switching between coding and evaluation.