aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-30 09:38:26 +0000
committerBlaž Hrastnik2021-03-30 09:38:26 +0000
commitdfc17becd56efbc1f65de7c8d65cb32ad4690db1 (patch)
tree15a1b60e2154bf259691b24ed48a071c6544a661 /helix-term/src/commands.rs
parente166da2ab051279f3086e0942f6b7adb1a641a84 (diff)
Move pickers under my leader key mode (space).
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 7233f1da..1b46aa62 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1853,3 +1853,23 @@ pub fn jump_backward(cx: &mut Context) {
doc.set_selection(selection);
};
}
+
+//
+
+pub fn space_mode(cx: &mut Context) {
+ cx.on_next_key(move |cx, event| {
+ if let KeyEvent {
+ code: KeyCode::Char(ch),
+ ..
+ } = event
+ {
+ // TODO: temporarily show SPC in the mode list
+ match ch {
+ 'f' => file_picker(cx),
+ 'b' => buffer_picker(cx),
+ // ' ' => toggle_alternate_buffer(cx),
+ _ => (),
+ }
+ }
+ })
+}