Expand description
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"]
Modules§
Macros§
- cmd_
plugin - format_
function_ plugin - Defines a new format function.
- format_
plugin - Defines a new format variable.
- notification_
plugin - Defines a new notification callback.