From Zero to "Hello world!" inside a Zellij Rust plugin with one keyboard shortcut.
All you have to do is think of a name for your new plugin and this wizard will:
- Clone the rust-plugin-example template repository into a folder by that name in your project directory
- Create a development workspace for you as a new tab, with your
$EDITOR
and a helper plugin to compile and run your plugin
The only prerequisites are Zellij 0.41.1
and up, and rust
(with cargo
) installed on your machine.
More about Zellij plugins: Zellij Documentation
To try this plugin out (from inside a Zellij session), you can either:
zellij plugin -- https://github.com/zellij-org/create-rust-plugin/releases/latest/download/create-rust-plugin.wasm
- Start the
plugin manager
withCtrl o
+p
, pressCtrl a
to load a new plugin and paste this URL:https://github.com/zellij-org/create-rust-plugin/releases/latest/download/create-rust-plugin.wasm
To bind it to a keybinding, add the following to your keybindings:
shared {
bind "Ctrl y" {
LaunchOrFocusPlugin "https://github.com/zellij-org/create-rust-plugin/releases/latest/download/create-rust-plugin.wasm" {
project_dir "/home/aram/code" // change-me!
floating true
move_to_focused_tab true
}
}
}
By default, this plugin will assume the folder where it was started is your project folder and clone plugins under it.
For example, if it was started in /home/aram/code
and you choose my-cool-plugin
as the plugin name, this wizard will create a new folder for your plugin as /home/aram/code/my-cool-plugin
.
To change this, run the plugin with the following configuration:
project_dir "/path/to/project_dir"