• Stars
    star
    1,768
  • Rank 26,319 (Top 0.6 %)
  • Language Fennel
  • License
    The Unlicense
  • Created about 6 years ago
  • Updated 11 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Interactive evaluation for Neovim (Clojure, Fennel, Janet, Racket, Hy, MIT Scheme, Guile, Python and more!)

Conversational software development for Neovim

Discord

Conjure is an interactive environment for evaluating code within your running program.

The core features of Conjure are language agnostic (although it’s targeted at Lisps for now), with each language client providing their own extra tools. Here’s the currently supported languages, contributions and 3rd party plugins that add clients are highly encouraged! You can find a comparison table for all clients and supported features in the wiki.

You can learn more about the mappings and configuration inside Neovim with :help conjure. Each language client also has it’s own specific help text under :help conjure-client-{LANGUAGE}-{TRANSPORT}, such as :help conjure-client-clojure-nrepl, which contains specific mappings and configuration for that client.

You can also get an interactive guide to the core principals and mappings by executing :ConjureSchool or by using the "try before you install" script as described further down this page.

User experience

What does wielding Conjure actually look like? What can you do with it?

asciicast

  • Open a file of a supported file type such as clojure or racket.

  • Some languages, such as Clojure, will automatically connect to your REPL or give you the commands and mappings to do so yourself.

  • Use various mappings to execute the code you’re interested in such as the current form, file, buffer or even form at a Neovim mark.

  • Every result is kept in a log buffer that you can access at any time.

  • Support for multiple asynchronous autocompletion frameworks, with deoplete built in (<C-x><C-o> also works!).

Conjure allows you to send the right part of your code off for evaluation, see the results, wrap the results in more code and evaluate that. It keeps a log of your actions and results so you don’t have to remember them, that context is extremely helpful when you’re down the rabbit hole of a bug hunt.

Evaluating a form under your cursor is as simple as <prefix>ee, where <prefix> defaults to <localleader>. Be sure to set your your <localleader> key or configure Conjure to use a different mapping prefix, see :h maplocalleader and :h g:conjure#mapping#prefix for more information.

The goal is to give you a tool that lets you effortlessly run whatever you need to while keeping out of your way (but there with context and more information if you need it).

Once installed you can run :ConjureSchool to begin an interactive tutorial.

Try without installing

You can trial run Conjure with the interactive :ConjureSchool tutorial without actually installing it! The only prerequisites are curl and an up to date nvim.

curl -fL conjure.fun/school | sh

This will temporarily download the plugin, launch Neovim with :ConjureSchool running and then clean up after itself. You get to try out what Conjure has to offer without having to edit your Neovim configuration.

Installation

Requires Neovim 0.7 or newer.

Alternatively you can use Magic Kit, an opinionated starter kit that includes all sorts of essential tools.

packer.nvim

use 'Olical/conjure'

vim-plug

Plug 'Olical/conjure'

lazy.nvim

return { "Olical/conjure" }

To take advantage of lazy loading, a bit more involved configuration is required:

Details
return {
    "Olical/conjure",
    ft = { "clojure", "fennel", "python" }, -- etc
    -- [Optional] cmp-conjure for cmp
    dependencies = {
        {
            "PaterJason/cmp-conjure",
            config = function()
                local cmp = require("cmp")
                local config = cmp.get_config()
                table.insert(config.sources, {
                    name = "buffer",
                    option = {
                        sources = {
                            { name = "conjure" },
                        },
                    },
                })
                cmp.setup(config)
            end,
        },
    },
    config = function(_, opts)
        require("conjure.main").main()
        require("conjure.mapping")["on-filetype"]()
    end,
    init = function()
	       -- Set configuration options here
        vim.g["conjure#debug"] = true
    end,
}

Mods

Modifications or mods are extra plugins that improve Conjure in various ways. They may add completion plugin support, entire language clients or new mappings that do fun and interesting things. You can learn about creating your own by reading the source code of the projects listed below as well as "Using Conjure programatically (API)" and "Client features".

Tree sitter support

Warning! If you want to work with ANY language that isn’t a Lisp dialect you will need to use tree sitter. If you do not use tree sitter only visual selection and vim motion based evaluations will work. You need tree sitter if you wish to evaluate non Lisp languages with <prefix>ee and other such form based evaluation mappings.

When you ask Conjure to evaluate the form under your cursor it has to understand the code enough to be able to find the boundaries and extract the right characters from the buffer. This used to be done using Neovim’s built in findpairpos, syntax highlighting regexes and exhaustive searching of the buffer. This is error prone, gets slow as the buffer grows and doesn’t work with non-Lisp languages which lack clear boundaries.

I highly recommend you set up tree sitter inside your Neovim configuration and :TSInstall [language] every language you’re interested in working with. You should then keep those tree sitter modules up to date as you upgrade Neovim since the API seems to change slightly over time.

Tree sitter allows you to work with non-Lisp languages like Julia as well as get far more accurate, smart and performant evaluations in languages like Clojure. You can learn more and get everything set up using the nvim-treesitter repository.

It’s technically optional since Conjure contains legacy fallback code, but I highly recommend tree sitter when using Conjure, it’s how you get cool things like smart comment block evaluations in Clojure and form based evaluations in Julia and Lua.

Getting started

The majority of the documentation can be found within :help conjure. You can also use :ConjureSchool to get an interactive introduction to the workflow and mappings Conjure provides. Refer to the list at the top of this file for links to the various quickstart guides for each language.

Please do get in touch via Discord or Twitter if you have any questions or issues.

Broader documentation can be found in the Conjure wiki, there you’ll find blog posts and guides that will help you get common workflows up and running. Contributions are encouraged!

Behind the curtain

Conjure is written entirely in Lua (no VimL or external processes!) which is compiled from Fennel by Aniseed ahead of time. Check out CONTRIBUTING.adoc for more on how to work on Conjure using itself.

Historically, Conjure was Clojure specific with an entirely different implementation, you can still find that version on the legacy-jvm branch.

Unlicenced

Find the full unlicense in the UNLICENSE file, but here’s a snippet.

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

More Repositories

1

EventEmitter

Evented JavaScript for the browser
JavaScript
3,127
star
2

react-faux-dom

DOM like structure that renders to React (unmaintained, archived)
JavaScript
1,206
star
3

aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
Fennel
610
star
4

dotfiles

Configuration for Linux, i3, Kitty, Fish, Neovim and more
Fennel
509
star
5

depot

Find newer versions of your dependencies in your deps.edn file
Clojure
259
star
6

nfnl

Enhance your Neovim with Fennel
Fennel
223
star
7

vim-enmasse

Edit every line in a quickfix list at the same time
Vim Script
208
star
8

magic-kit

A starter kit for Conjure, Aniseed and Neovim
Fennel
104
star
9

cljs-test-runner

Discover and run your ClojureScript tests
Clojure
86
star
10

Heir

Helper functions for prototypical inheritance in JavaScript
JavaScript
60
star
11

lazy-array

JavaScript lazy arrays, sort of like Clojure's seqs
JavaScript
56
star
12

nvim-local-fennel

Execute local Fennel Lisp files in Neovim upon startup
Lua
54
star
13

clojure-dap

DAP server for debugging Clojure over nREPL with CIDER's debugger
Clojure
52
star
14

tuple

A tiny JavaScript tuple implementation
JavaScript
49
star
15

propel

Propel helps you start Clojure(Script) REPLs with a prepl
Clojure
48
star
16

snowball

Voice activated Discord bot running on GCP
Clojure
41
star
17

vim-expand

Expand things like {foo,bar}, {1..10} and $HOME inline with a single command
Vim Script
30
star
18

nand2tetris

My workings for book / project. Don't copy them for the Coursera course!
Assembly
29
star
19

vim-scheme

Interact with MIT Scheme from Neovim (deprecated, use Conjure instead!)
Vim Script
29
star
20

gh-pages-theme

A clean concise theme for your GitHub projects
JavaScript
28
star
21

color

Color conversion functions for JavaScript
JavaScript
25
star
22

binary-search

Binary search implementation in JavaScript born from a couple of my blog posts
JavaScript
24
star
23

conjure-sourcery

Experimental rewrite of Conjure in Lua via Fennel - success, this is for historical purposes
Common Lisp
20
star
24

exemplary

Turns your examples into documentation and runnable tests.
Clojure
19
star
25

clojure-giants-shoulders

Tools and scripts I reach for every time I start a new Clojure project
Clojure
18
star
26

spacy-neovim

A base Neovim configuration template inspired by Spacemacs
Vim Script
17
star
27

StateMachine

JavaScript state machine
JavaScript
16
star
28

blog

My personal blog
CSS
15
star
29

github.js

Frontend JavaScript library for interacting with the GitHub API v3
JavaScript
14
star
30

vim-syntax-expand

Expand characters to code if not in a comment or string
Vim Script
13
star
31

bonsai

[WIP] Declarative DOM rendering with integrated state management for ClojureScript
Clojure
12
star
32

Spark

A lightweight yet powerful JavaScript library
JavaScript
12
star
33

d3-react

Render React elements with D3
JavaScript
12
star
34

lein-transcriptor

Execute all of your project's .repl files with transcriptor.
Clojure
11
star
35

Mappa

Map functions under your own names to create your own set of tools.
JavaScript
9
star
36

neofib

An example Neovim plugin written in Rust using neovim-lib
Rust
7
star
37

lab

A place for experiments
CSS
7
star
38

kkslider

A super simple Neovim slide show plugin
Lua
7
star
39

bastion

[DEPRECATED] Combines a modern JavaScript toolchain into a single program so you can stop worrying about configuration and just get to work on your application
JavaScript
7
star
40

more

A framework for LESS, including mixins and a grid system
6
star
41

jsFiddle-extension

A Google chrome extension for browsing and creating fiddles.
JavaScript
6
star
42

clojure-hey-example

A demo repo for my blog post on deps.edn based projects
Clojure
5
star
43

brainfucks

Brainfuck VM implementations in various languages
Rust
5
star
44

conjure-deps

Runtime dependencies for Conjure
Clojure
5
star
45

nfnl-plugin-example

An example Neovim plugin witten in Fennel using nfnl
Fennel
4
star
46

tm-challenge

Room manifest manger built with React / Reflux
JavaScript
4
star
47

prepl-compliance-test

Checks a Clojure prepl server against a bunch of tests
Clojure
4
star
48

clj-dice-roller

Clojure ns that rolls dice, just a transcriptor example
Clojure
3
star
49

impl

[WIP] Homoiconic language with minimal syntax compiling to JavaScript
JavaScript
3
star
50

advent-of-code

My attempts at the Advent of Code
Clojure
3
star
51

sicp

Studying SICP
Scheme
3
star
52

clojure-wake-word-detection

Code for my blog post
Clojure
3
star
53

Package.js

Add package support to the browser
JavaScript
3
star
54

cljs-todo

Simple ClojureScript to do list example using Reagent and Bonsai
Clojure
2
star
55

vim-netrw-signs

Like vim-signify, but for netrw
Vim Script
2
star
56

astronvim-config

My personal AstroNvim user extensions. This is now migrated into my dotfiles repo.
Lua
2
star
57

wlhn-a-star

A* algorithm implementation in Clojure
Clojure
2
star
58

collatz

Collatz conjecture computation with snazzy rendering.
Clojure
2
star
59

crawlers

Clojure(Script) library to identify crawler and bot user agent strings
Clojure
2
star
60

oli.me.uk

[SUPER DEPRECATED] Only keeping for historical reasons.
Ruby
2
star
61

cljs-react-example

A simple example of loading React into ClojureScript from node_modules (yarn)
Clojure
2
star
62

conjure-shadow-cljs-example

How to hook Conjure up to shadow-cljs
Clojure
2
star
63

algos

My coursera algos code
Java
2
star
64

Clarity

A clean and responsive WordPress theme.
PHP
2
star
65

venturi

Hierarchical JavaScript dependency injection
JavaScript
1
star
66

sparkjs.co.uk

Website for the Spark JavaScript library
1
star
67

Physics

A particle physics engine built in JavaScript using MooTools
JavaScript
1
star
68

web-asset-compiler

Combines and minifies your CSS, LESS and JavaScript into one JavaScript file
JavaScript
1
star
69

euler

Solutions for my Project Euler account
Clojure
1
star
70

hello-godot

Experimenting with the Godot game engine
C
1
star
71

tarmac

Tiny and unopinionated AMD MVC JavaScript framework
JavaScript
1
star
72

HashStorage

Watches the URLs hash for changes and merges those changes with an existing object, allowing storage of complex data in a sharable URL
JavaScript
1
star
73

wlhn-elfs-dilemma

Prisoners dilemma client for the West London Hack Night 2017 Christmas special
Clojure
1
star
74

langs

My work for the "7 languages in 7 weeks" book
Io
1
star
75

cljit

Git implemented in Clojure from following along with Building Git
1
star
76

fenneldoc

Turn Fennel docstrings into rich markdown documentation (mirror)
Fennel
1
star
77

project-wide-operations

Project-wide operations in Vim, a talk for Vim London
1
star
78

conjure-loves-fennel

Doesn't work, just sharing so others can take it and run with it!
Lua
1
star
79

sentinel

[DEPRECATED] Watch source files for changes and processes them accordingly
JavaScript
1
star
80

vim-scotch

A few extra mappings for vim-fireplace
Vim Script
1
star
81

how-to-be-a-repl-sorcerer

Clojure
1
star
82

hack-the-tower-clojure-web

A small web project in Clojure from Hack the Tower
Clojure
1
star
83

aniseed-config-from-scratch

A demo repo from my YouTube video showing setting up an Aniseed based Neovim configuration
Vim Script
1
star
84

outline

A web based CSS grid generator.
JavaScript
1
star
85

simple-crypt-cljs

Simple encryption example in the browser with ClojureScript
Clojure
1
star
86

dwarf-fortress-nix

Dwarf Fortress on Nix
Nix
1
star
87

fizzbugged

A broken Clojure Fizz Buzz that I fix with Conjure in a blog post
Clojure
1
star
88

olical.github.io

DEPRECATED, see Olical/blog for new source code
HTML
1
star
89

forc

Clone of Clojure list comprehension in JavaScript
JavaScript
1
star
90

SparkAn

Animate CSS properties of the specified element - For the Spark JavaScript library
JavaScript
1
star
91

vimconf-2020

Lua
1
star
92

ChromePlate

A base layout for your Chrome apps and extensions
JavaScript
1
star
93

matchmaker

Constructs (fairly) balanced teams from the TAW attendance list
Clojure
1
star
94

life

Game of life implementations in different languages
Clojure
1
star
95

clojs

Repository for my post: A JavaScript / Clojure mashup
JavaScript
1
star
96

rust-book

Notes and exercises from working through the Rust book
Rust
1
star