neovim_lib/
lib.rs

1//! # Rust library for Neovim clients
2//!
3//! Implements support for rust plugins for [Neovim](https://github.com/neovim/neovim) through its msgpack-rpc API.
4//! # Examples
5//! ## Simple use case
6//! ```no_run
7//! use neovim_lib::{Neovim, NeovimApi, Session};
8//!
9//! let mut session = Session::new_tcp("127.0.0.1:6666").unwrap();
10//! session.start_event_loop();
11//! let mut nvim = Neovim::new(session);
12//!
13//! let buffers = nvim.list_bufs().unwrap();
14//! buffers[0].set_lines(&mut nvim, 0, 0, true, vec!["replace first line".to_owned()]).unwrap();
15//! nvim.command("vsplit").unwrap();
16//! let windows = nvim.list_wins().unwrap();
17//! windows[0].set_width(&mut nvim, 10).unwrap();
18//! ```
19//! ## Process notify events from neovim
20//!
21//! ```no_run
22//! use neovim_lib::{Neovim, NeovimApi, Session};
23//! let mut session = Session::new_tcp("127.0.0.1:6666").unwrap();
24//! let receiver = session.start_event_loop_channel();
25//! let mut nvim = Neovim::new(session);
26//!
27//! let (event_name, args) = receiver.recv().unwrap();
28//!
29//! ```
30extern crate rmp;
31extern crate rmpv;
32#[macro_use]
33extern crate log;
34
35#[cfg(unix)]
36extern crate unix_socket;
37
38mod rpc;
39#[macro_use]
40pub mod session;
41pub mod async;
42pub mod neovim;
43pub mod neovim_api;
44pub mod neovim_api_async;
45
46pub use async::AsyncCall;
47pub use neovim::{CallError, Neovim, UiAttachOptions, UiOption};
48pub use neovim_api::NeovimApi;
49pub use neovim_api_async::NeovimApiAsync;
50pub use session::Session;
51
52pub use rmpv::{Integer, Utf8String, Value};
53pub use rpc::handler::{Handler, RequestHandler};