Skip to content

Commit 41132ec

Browse files
committed
Update socket repl plugin readme todo
1 parent 6b28377 commit 41132ec

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

socket-repl-plugin/README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,35 @@ TODO: architecture diagram
1010

1111
## Usage
1212

13-
After starting a Clojure application with a socket repl server.
13+
Start a Clojure program with a socket repl server. This can be done by
14+
adding the following JVM options to any Clojure application.
15+
16+
```
17+
-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"
18+
```
19+
20+
Then, from within Neovim, connect to the socket repl.
1421

1522
```
1623
:Connect <host> <port>
1724
```
1825

19-
Create a buffer for displaying interaction with the repl. In that buffer:
26+
Create a buffer for displaying interaction with the repl.
2027

2128
```
29+
:vnew
2230
:ReplLog
2331
```
2432

2533
From there, to eval any buffer or form under cursor use:
2634

2735
```
2836
:EvalBuffer
37+
```
38+
39+
or
40+
41+
```
2942
:EvalCode
3043
```
3144

@@ -52,12 +65,19 @@ This plugin requires a version of the Java version 1.6 or higher. You've probabl
5265

5366
## Developing
5467

55-
Start Neovim using:
68+
Start Neovim using, open the debug plugin script.
5669

5770
```
5871
NVIM_LISTEN_ADDRESS=127.0.0.1:7777 nvim plugin/socketrepl.vim.debug
5972
```
6073

74+
From within Neovim, source the debug plugin script. This causes it to use
75+
a socket connection, rather than stdio to communicate with the plugin.
76+
77+
```
78+
:so %
79+
```
80+
6181
Start the plugin. Then you'll need to connect to Neovim from the repl.
6282

6383
```
@@ -66,11 +86,18 @@ $> nc localhost 5555
6686
user=> (go)
6787
```
6888

69-
or, with Leiningen:
89+
or, with Leiningen
7090

7191
```
7292
$> lein repl
7393
$> (go)
7494
```
7595

76-
You can now use plugin commands from within Neovim `:Connect`, `:EvalBuffer`, etc.
96+
You can now use plugin commands from within Neovim `:Connect`, `:EvalBuffer`,
97+
etc.
98+
99+
Note that you'll probably want to rely heavily on the asynchronous
100+
neovim-client functions when you want (the plugin) to make a request
101+
of neovim. This is because the Neovim function `rpcrequest` blocks until
102+
it has received a response (from your plugin). Using async on the plugin
103+
side is the easiest way to avoid deadlock.

socket-repl-plugin/TODO

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ TODO alpha
1515
[_] implement doc (word under cursor)
1616
[_] Pass host, port in connect
1717
[_] Update README
18-
Move NVIM_LISTEN... stuff to a debug section
18+
[X] Move NVIM_LISTEN... stuff to a debug section
19+
[_] demo video
20+
[_] architecture diagram
21+
nvim<--msgpack/stdio-->plugin(jar)<--localhost:5555-->socketrepl
1922

20-
TODO final
23+
TODO next
2124
[_] Rather than explicit repl output logging, can we intercept
2225
channel
2326
stream implementation
24-
[_] Shut down the plugin if no input received for one minute
27+
[X] Shut down the plugin if no input received for one minute
2528
[X] evaluate form under cursor
2629

2730
Goals
@@ -45,28 +48,6 @@ Goals
4548
Accessible from vim buffer `:call ShowClojurePluginRepl()`
4649
-Not a way of life
4750
Does not include paredit, syntax highlight, etc
48-
-Architecture Diagram
49-
nvim <--msgpack/stdio--> plugin (jar) <--localhost:5555--> socket repl
5051

5152
Questions
5253
Figwheel cljs-repl support
53-
54-
Usage/Installation
55-
no other install outside of normal plugin (pathogen, vundle, etc)
56-
** except the rtp thing **
57-
add command line args to your project, so it starts socket repl
58-
-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"
59-
on `:Connect` specify port (and host) to connect to
60-
split a pane, `:ReplLog`
61-
62-
Debugging notes
63-
vim
64-
start vim w/ NVIM_LISTEN_ADDRESS
65-
`:so` plugin/socket-repl.vim.debug script
66-
clj
67-
start plugin w/ `run.sh`
68-
this also starts a socket repl on 5555
69-
note: use async!
70-
: vim blocks if you make a synchronous call to clj which makes a sync
71-
: call back to vim -- use async!
72-

0 commit comments

Comments
 (0)