├── .cargo └── config.toml ├── .gitignore ├── Cargo.toml ├── README.md ├── plugin.yaml └── src └── main.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | target = "wasm32-wasi" 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "{{project-name}}" 3 | version = "0.1.0" 4 | authors = ["{{authors}}"] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | zellij-tile = "1.0.0" 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## About 2 | 3 | This template is designed for writing [Zellij][zellij] plugins in Rust. 4 | 5 | You can learn more about developing plugins in the [Zellij Documentation][docs]. 6 | 7 | [zellij]: https://github.com/zellij-org/zellij 8 | [docs]: https://zellij.dev/documentation/plugins.html 9 | 10 | ## Usage 11 | 12 | ### Use `cargo generate` to Clone this Template 13 | 14 | [Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) 15 | 16 | ``` 17 | cargo generate --git https://github.com/zellij-org/rust-plugin-template.git --name my-project 18 | cd my-project 19 | ``` 20 | 21 | ### Build with `cargo` and Test in Zellij 22 | 23 | ```sh 24 | # If you don't have Zellij installed already 25 | cargo install zellij 26 | # Building the plugin 27 | cargo build 28 | # Running in Zellij 29 | zellij -l plugin.yaml 30 | ``` 31 | -------------------------------------------------------------------------------- /plugin.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | template: 3 | direction: Horizontal 4 | parts: 5 | - direction: Vertical 6 | borderless: true 7 | split_size: 8 | Fixed: 1 9 | run: 10 | plugin: 11 | location: "zellij:tab-bar" 12 | - direction: Vertical 13 | body: true 14 | - direction: Vertical 15 | run: 16 | plugin: 17 | location: "file:target/wasm32-wasi/debug/{{project-name}}.wasm" 18 | - direction: Vertical 19 | borderless: true 20 | split_size: 21 | Fixed: 2 22 | run: 23 | plugin: 24 | location: "zellij:status-bar" 25 | tabs: 26 | - direction: Vertical 27 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use zellij_tile::prelude::*; 2 | 3 | #[derive(Default)] 4 | struct State; 5 | 6 | register_plugin!(State); 7 | 8 | impl ZellijPlugin for State { 9 | fn load(&mut self) {} 10 | 11 | fn update(&mut self, event: Event) {} 12 | 13 | fn render(&mut self, rows: usize, cols: usize) {} 14 | } 15 | --------------------------------------------------------------------------------