1 unstable release
0.0.1 | Apr 28, 2019 |
---|
#5 in #tmux-plugin
685KB
23K
SLoC
This is a library for writing plugins for tmux
in Rust.
To use these plugins requires the use of a fork of tmux
that supports this plugin system.
This is still very experimental. Use it at your own risk.
lib.rs
:
A library for writing tmux plugins in Rust. To use tmux plugins you will need to use a fork of tmux that has plugin support.
Basic usage
Use one of the macros exported by this library to define a plugin. For instance, to define a format plugin:
// This plugin does the same thing as the built in "window_width".
use tmux_plugin::format_plugin;
use std::ffi::CString;
format_plugin!(b"my_window_width\0", |format_tree| {
CString::new(
format!("{}", unsafe { *(*format_tree).w }.sx)
).unwrap()
});
Then compile your crate as a dynamic library, by adding this to your [lib]
section in your Cargo.toml
:
[lib]
name = "..." # Your plugin's name
crate-type = ["cdylib"]