aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-06-14 17:11:02 +0200
committerGitHub <noreply@github.com>2024-06-14 17:11:02 +0200
commit1f0ae94f01647eab66cabbd11434ecae1fac8da3 (patch)
treeb568f9ffc2064f4bdfd9c02c0aa5e581a3d1e750 /default-plugins
parentdocs(readme): add name origin section (#3391) (diff)
downloadsl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.tar.gz
sl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.tar.xz
sl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.zip
feat(plugins): rebind keys at runtime (#3422)
* refactor(server): interpret keys on server so they can be rebound * feat(plugins): allow rebinding keys at runtime * various cleanups * add tests * style(fmt): rustfmt * fix(tests): address (some) e2e test flakiness * style(fmt): rustfmt
Diffstat (limited to 'default-plugins')
-rw-r--r--default-plugins/fixture-plugin-for-tests/src/main.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/default-plugins/fixture-plugin-for-tests/src/main.rs b/default-plugins/fixture-plugin-for-tests/src/main.rs
index f504eec8..b6cac35b 100644
--- a/default-plugins/fixture-plugin-for-tests/src/main.rs
+++ b/default-plugins/fixture-plugin-for-tests/src/main.rs
@@ -56,6 +56,7 @@ impl ZellijPlugin for State {
PermissionType::WebAccess,
PermissionType::ReadCliPipes,
PermissionType::MessageAndLaunchOtherPlugins,
+ PermissionType::RebindKeys,
]);
self.configuration = configuration;
subscribe(&[
@@ -318,6 +319,18 @@ impl ZellijPlugin for State {
Some(std::path::PathBuf::from("/tmp")),
);
},
+ BareKey::Char('0') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
+ rebind_keys(
+ "
+ keybinds {
+ locked {
+ bind \"a\" { NewTab; }
+ }
+ }
+ "
+ .to_owned(),
+ );
+ },
_ => {},
},
Event::CustomMessage(message, payload) => {