Skip to content

Commit 6b28377

Browse files
committed
Update neovim-client readme
1 parent c98fde5 commit 6b28377

File tree

1 file changed

+33
-49
lines changed

1 file changed

+33
-49
lines changed

README.md

Lines changed: 33 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
11
# neovim-client
22

3-
A Neovim client library for creating plugins written in Clojure, using
4-
msgpack-rpc + a sample plugin.
5-
6-
Note that this is pretty much reference implementation quality at best
7-
-- nothing Clojars worthy as yet. The ultimate goal here is the easiest,
8-
most effective possible Vim plugins written with Clojure.
3+
A Neovim client library for creating plugins written in Clojure.
94

105
## Dependencies
116

127
### Neovim
138

14-
I've been building from [master](https://github.com/neovim/neovim).
15-
16-
### Leiningen
17-
18-
At least version 2.5.2 of [Leiningen](https://github.com/technomancy/leiningen/).
9+
I've been building from [master](https://github.com/neovim/neovim). Currently,
10+
I'm using `NVIM v0.1.2-220-g3b94756`.
1911

2012
### Java
2113

22-
You've probably already got this if you're using Clojure. If not, whatever JVM your package manager installs should work.
14+
You've probably already got this if you're using Clojure. Version 1.6 or later is required.
2315

2416
## Usage
2517

2618
### Repl
2719

28-
Launch Neovim, explicitly setting the NVIM_LISTEN_ADDRESS
20+
Launch Neovim, explicitly setting the `NVIM_LISTEN_ADDRESS`
2921

30-
NVIM_LISTEN_ADDRESS=127.0.0.1:7777 nvim
22+
```
23+
NVIM_LISTEN_ADDRESS=127.0.0.1:7777 nvim
24+
```
3125

32-
From the cloned repository's directory:
26+
From repository:
3327

34-
lein repl
35-
neovim-client.nvim=> (connect! "localhost" 7777)
36-
...
37-
neovim-client.nvim=> (run-command! ":echo 'Hello Neovim!'")
38-
...
28+
```
29+
$> lein repl
30+
neovim-client.nvim=> (connect! "localhost" 7777)
31+
...
32+
neovim-client.nvim=> (run-command! ":echo 'Hello Neovim!'")
33+
...
34+
```
3935

4036
[![Repling Neovim](http://img.youtube.com/vi/g-9DdVwbSTo/0.jpg)](https://www.youtube.com/watch?v=g-9DdVwbSTo)
4137

@@ -45,54 +41,42 @@ Several sample plugins -- consumers of neovim-client -- are included.
4541

4642
#### Installation
4743

48-
For now (no Clojars yet), we need neovim-client installed locally, so from
49-
the cloned repository's directory:
50-
51-
lein install
52-
53-
Install sample-plugin-whatever however you normally do it. For example, using
54-
Vundle you'd add the following line to your .vimrc:
55-
56-
Plugin 'file:///path/to/neovim-client', {'rtp': 'sample-plugin-whatever/'}
57-
58-
Finally, to invoke the plugin launch nvim and run:
59-
60-
:VundleInstall
44+
While these plugins can be installed locally, the easiest thing to do is to
45+
run them from the repl, as described above. Simply use `lein repl` from the
46+
plugin project's root directory.
6147

6248
#### Simple Plugin
6349

64-
:call RunSamplePluginSimple()
50+
```
51+
:call RunSamplePluginSimple()
52+
```
6553

6654
#### Count Plugin
6755

6856
This plugin stays running, and maintains state. Additionally, it shows how
6957
plugins are actually servers, which Neovim can make requests to via
7058
rpcrequest().
7159

72-
:echo SamplePluginCount() ;; repeat!
60+
```
61+
:echo SamplePluginCount()
62+
```
63+
64+
#### Socket Repl Plugin
65+
66+
TODO
7367

7468
## Future
7569

7670
### Tighter Integration with Neovim
7771

78-
Neovim's strategy for [remote plugins](http://neovim.io/doc/user/remote_plugin.html#remote-plugin) says that it's ok to create a remote plugins as "arbitrary programs that communicate directly with the high-level Nvim API and are called via [msgpack-rpc]". That's exactly what the included sample-plugin does (utilizing neovim-client).
72+
Neovim's strategy for [remote plugins](http://neovim.io/doc/user/remote_plugin.html#remote-plugin) says that it's ok to create a remote plugins as "arbitrary programs that communicate directly with the high-level Nvim API and are called via [msgpack-rpc]". That's exactly what the included sample-plugin does (utilizing neovim-client).
7973

8074
However, it goes on to outline a better approach, utilizing a "plugin host". While neovim-client could potentially fill that role, considerably more work is needed.
8175

82-
The bottom line is this works, and possibly using ClojureScript w/ node.js, it could be fast too!
83-
84-
### Leiningen Template
85-
86-
A Leiningen template for a Neovim plugin, using neovim-client, and including
87-
the necessary VimScript hooks.
88-
89-
### Stop Using lein run
90-
91-
Using a VimScript hook, Neovim calls `lein run` to launch the plugin. This isn't
92-
really Leiningen's job, but it's convenient for a few reasons:
76+
### Performance
9377

94-
* Single script to distribute, rather than clojure.jar, plugin jar, etc.
95-
* Makes it easy for a plugin user to modify it - just edit .clj source.
78+
Individual plugins can be distributed as jars using AOT compilation, as is the
79+
case for the socket repl plugin. Additionally, porting this client library to Clojurescript would facilitate a fast startup time, via Node.
9680

9781
## License
9882

0 commit comments

Comments
 (0)