[][src]Crate neovim_lib

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();

Re-exports

pub use async::AsyncCall;
pub use neovim::CallError;
pub use neovim::Neovim;
pub use neovim::UiAttachOptions;
pub use neovim::UiOption;
pub use neovim_api::NeovimApi;
pub use neovim_api_async::NeovimApiAsync;
pub use session::Session;

Modules

async
neovim
neovim_api
neovim_api_async
session

Structs

Integer

Represents a MessagePack integer, whether signed or unsigned.

Utf8String

Represents an UTF-8 MessagePack string type.

Enums

Value

Represents any valid MessagePack value.

Traits

Handler
RequestHandler