#neovim

neovim-lib

msgpack-rpc neovim client

17 releases

Uses old Rust 2015

0.6.1 Apr 12, 2019
0.6.0 Jan 27, 2019
0.5.4 Aug 10, 2018
0.5.3 Jun 13, 2018
0.1.0 Mar 15, 2016

#13 in Text editors

Download history 149/week @ 2020-06-03 106/week @ 2020-06-10 113/week @ 2020-06-17 84/week @ 2020-06-24 130/week @ 2020-07-01 69/week @ 2020-07-08 124/week @ 2020-07-15 90/week @ 2020-07-22 94/week @ 2020-07-29 90/week @ 2020-08-05 179/week @ 2020-08-12 164/week @ 2020-08-19 159/week @ 2020-08-26 187/week @ 2020-09-02 130/week @ 2020-09-09 119/week @ 2020-09-16

512 downloads per month
Used in 4 crates

LGPL-3.0

100KB
2.5K SLoC

neovim-lib

Rust library for Neovim msgpack-rpc clients.

Linux build Windows build

Where to start


lib.rs:

Rust library for Neovim clients

Implements support for rust plugins for Neovim through its msgpack-rpc API.

Examples

Simple use case

use neovim_lib::{Neovim, NeovimApi, Session};

let mut session = Session::new_tcp("127.0.0.1:6666").unwrap();
session.start_event_loop();
let mut nvim = Neovim::new(session);

let buffers = nvim.list_bufs().unwrap();
buffers[0].set_lines(&mut nvim, 0, 0, true, vec!["replace first line".to_owned()]).unwrap();
nvim.command("vsplit").unwrap();
let windows = nvim.list_wins().unwrap();
windows[0].set_width(&mut nvim, 10).unwrap();

Process notify events from neovim

use neovim_lib::{Neovim, NeovimApi, Session};
let mut session = Session::new_tcp("127.0.0.1:6666").unwrap();
let receiver = session.start_event_loop_channel();
let mut nvim = Neovim::new(session);

let (event_name, args) = receiver.recv().unwrap();

Dependencies

~0.6–0.9MB
~17K SLoC