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

#213 in Text editors

Download history 136/week @ 2023-11-20 120/week @ 2023-11-27 103/week @ 2023-12-04 155/week @ 2023-12-11 152/week @ 2023-12-18 132/week @ 2023-12-25 61/week @ 2024-01-01 133/week @ 2024-01-08 199/week @ 2024-01-15 114/week @ 2024-01-22 75/week @ 2024-01-29 94/week @ 2024-02-05 114/week @ 2024-02-12 185/week @ 2024-02-19 357/week @ 2024-02-26 234/week @ 2024-03-04

909 downloads per month
Used in 7 crates

LGPL-3.0

105KB
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.7–1MB
~22K SLoC