Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
a neovim plugin to connect with nrepl and socket repls
Lua Vim script
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
lua
plugin
README.md
repl-alliance.svg

README.md

A plugin for neovim that connects with nREPL as well as socket REPL servers.

The plugin is a work in progress, so be careful.

Installation

    Plug 'kolja/repl-alliance'

Usage

commands and bindings effect
:RAconnect asks for protocol, host and port and connects to a repl
:RAeval <expr> sends <expr> to the repl
:RAdescribe show Commands
:RAloadfile (re-)evaluates file from the current buffer
<leader>e<motion> sends the code from <motion> to the repl
<leader>e in Visual mode: sends selection to the repl
<leader>E prompts for code in the commandline
<leader>E in Visual mode: prepopulates the prompt with code from selection

For example with guns/vim-sexp installed, you can <leader>eaf to evaluate the form under the cursor, and gvp to replace it with whatever it evaluated to.

Repl Alliance uses these variables for configuration:

    replPort = "59555"
    replServer = "127.0.0.1"
    replNamespace = "user"
    replProtocol = "nrepl"

    " for how long to show virtual text (0 : don't show at all)
    replVirtual = 1000
    " path to the file that will be send to the repl when you call repl:send_blob(<blob>)
    replBlobPath = `<path>`

You can set them in your vimrc and call require("nrepl"):connect() or pass the values to connect() directly, like so:

    lua repl = require("nrepl"):connect(<host>, <port> [,<namespace>])

This autocommand will connect with a repl when you open a clojure file:

    autocmd FileType clojure lua repl = require("nrepl"):connect()

How to contribute

Open an issue in the github project and/or create a pull request.

Contributors

License

MIT

You can’t perform that action at this time.