Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings_panel: Bind vim keys to SettingsPanelMenu.

aryanshridhar9f9259683c9e
diff --git a/static/js/keydown_util.js b/static/js/keydown_util.js
index ace21ffabcc..11237fa0a79 100644
--- a/static/js/keydown_util.js
+++ b/static/js/keydown_util.js
@@ -8,6 +8,10 @@ const keys = {
38: "up_arrow",
39: "right_arrow",
40: "down_arrow",
+ 72: "vim_left",
+ 74: "vim_down",
+ 75: "vim_up",
+ 76: "vim_right",
};
export function handle(opts) {
diff --git a/static/js/settings_panel_menu.js b/static/js/settings_panel_menu.js
index d21f2385ac6..ec3b9bad961 100644
--- a/static/js/settings_panel_menu.js
+++ b/static/js/settings_panel_menu.js
@@ -70,6 +70,12 @@ export class SettingsPanelMenu {
enter_key: () => this.enter_panel(),
up_arrow: () => this.prev(),
down_arrow: () => this.next(),
+
+ // Binding vim keys as well
+ vim_left: toggler.maybe_go_left,
+ vim_right: toggler.maybe_go_right,
+ vim_up: () => this.prev(),
+ vim_down: () => this.next(),
},
});
}