Skip to content

Commit c98fde5

Browse files
committed
Add socket repl plugin readme
1 parent 6faf14a commit c98fde5

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

socket-repl-plugin/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Neovim Socket Repl Plugin
2+
3+
A [Neovim](https://github.com/neovim/neovim) plugin for Clojure which uses the build in [socket repl](http://clojure.org/reference/repl_and_main#_launching_a_socket_server) introduced in version 1.8 of Clojure.
4+
5+
This plugin uses the [Neovim Clojure plugin host](https://github.com/jebberjeb/neovim-client). While intended to be a demonstration of the plugin host library, it may also be suitable for daily Clojure development.
6+
7+
Simply, this plugin uses a socket connection to send code to the repl. Nothing (very little) more. All (most) of the plugin code is written using Clojure. There's no (some) VimScript to sift through. This plugin is probably a bit too transparent. You see absolutely everything that's sent to the repl. If you eval an entire buffer...
8+
9+
TODO: architecture diagram
10+
11+
## Usage
12+
13+
After starting a Clojure application with a socket repl server.
14+
15+
```
16+
:Connect <host> <port>
17+
```
18+
19+
Create a buffer for displaying interaction with the repl. In that buffer:
20+
21+
```
22+
:ReplLog
23+
```
24+
25+
From there, to eval any buffer or form under cursor use:
26+
27+
```
28+
:EvalBuffer
29+
:EvalCode
30+
```
31+
32+
TODO: demo video
33+
34+
## Installation
35+
36+
Install however you normally do it. For example, using Vundle you'd add the
37+
following line to your `.vimrc`:
38+
39+
```
40+
Plugin 'jebberjeb/neovim-client', {'rtp': 'socket-repl-plugin/'}
41+
```
42+
43+
Then (after sourcing `.vimrc`), from neovim:
44+
45+
```
46+
:VundleInstall
47+
```
48+
49+
## Dependencies
50+
51+
This plugin requires a version of the Java version 1.6 or higher. You've probably already got this if you're using Clojure.
52+
53+
## Developing
54+
55+
Start Neovim using:
56+
57+
```
58+
NVIM_LISTEN_ADDRESS=127.0.0.1:7777 nvim plugin/socketrepl.vim.debug
59+
```
60+
61+
Start the plugin. Then you'll need to connect to Neovim from the repl.
62+
63+
```
64+
$> ./run-dev.sh
65+
$> nc localhost 5555
66+
user=> (go)
67+
```
68+
69+
or, with Leiningen:
70+
71+
```
72+
$> lein repl
73+
$> (go)
74+
```
75+
76+
You can now use plugin commands from within Neovim `:Connect`, `:EvalBuffer`, etc.
File renamed without changes.

0 commit comments

Comments
 (0)