Fork me on GitHub
#vim
<
2017-01-13
>
dominicm22:01:11

https://github.com/bpiel/sayid/issues/8 also looks like there's some interest in this coming to vim 🙂

jebberjeb22:01:03

Was there a conj talk about this?

jebberjeb22:01:16

I remember seeing it recently.

dominicm22:01:26

I've heard it was mentioned. I found it on reddit 🙂

dominicm23:01:23

that's awesome

jebberjeb23:01:51

Yeah, I got a kick out of that.

dominicm23:01:05

I really like justinmk's vision.

jebberjeb23:01:45

Good timing — been thinking about how to version this api client library. I do too, I’m reading some issues on Github re: api versioning and he seems to be a champion of simplicity.

dominicm23:01:17

Yeah. I always enjoy reading his rationales on things. Although things sometimes seem to be so obvious to him, and not obvious to others and he needs a little prompting in order to explain.

dominicm23:01:54

Took a while for him to put together his big post on why neovim's async api is better than vim8's (and it hugely is imo)

jebberjeb23:01:13

hmm, I don’t think I read that

dominicm23:01:27

It was buried in a reddit comment somewhere on /r/neovim

jebberjeb23:01:50

Does vim8 have an async rpc api?

jebberjeb23:01:56

with bidirectional communication?

dominicm23:01:00

> rpc api no

dominicm23:01:23

I am under the impression vim8 actually invented it's own api on top of tcp

jebberjeb23:01:24

Google not turning up much, but I’m curious. You can hit Neovim’s RPC API w/ TCP or Unix Domain sockets, as well as STDIO.

dominicm23:01:57

I can't find justin's post now. hmph.

dominicm23:01:59

I wish I had an easier way to search reddit. This isn't the first time I've done this recently.

dominicm23:01:42

I didn't realise that neovim's api supported plain ol' things like stdio. That's cool.

jebberjeb23:01:44

Yes, when you use jobstart() to fire off a remote plugin (as a co-process), the plugin process can use STDIO as the channel.

dominicm23:01:06

ah, I see. Yes, I knew about that then.

dominicm23:01:28

I thought I could just pipe into a file and control neovim remotely 😛

jebberjeb23:01:10

heh, not quite 🙂

jebberjeb23:01:23

That… would… be neat though

jebberjeb23:01:07

Technically I suppose you can just telnet to a tcp socket and do it… If you’re fluent in messagepack 🙂

dominicm23:01:52

> Vim invented an ad-hoc protocol (it does not implement JSON-RPC) where JSON blobs can be sent over a channel and each blob has a request id and some other metadata. > In Vim a channel can have any protocol; this leaves quite a burden on the community to figure out a consensus. JSON also is very awkward (broken) for transporting binary data.

dominicm23:01:19

I always interact with neovim via my hex editor or something esoteric like that, right?

jebberjeb23:01:11

So you have some tcp socket you can write json to? What does vim do with it?

dominicm23:01:05

put it onto a channel

dominicm23:01:54

then you write vimscript to do something once it's got something on the channel

jebberjeb23:01:10

Wow, so no actual API? Your vimscript has to parse the json and react arbitrarily?

dominicm23:01:02

I think the JSON is parsed for you. I think that's why it has a request id, so vim can direct the message

dominicm23:01:27

yeah, the api is super ad-hoc

dominicm23:01:43

I mean, the vim community hacks around shit all the time.

jebberjeb23:01:13

yikes, remove VimL execution. Building a Clojure client for that would only be marginally better than a Clojure -> VimL compiler.

dominicm23:01:23

yeah, exactly.

jebberjeb23:01:20

Great post, very encouraging to those of us devoting our personal hacking hours to it.

dominicm23:01:48

Definitely. I will admit to having a small ?? over vim8, and justin easily steered me back