mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-02 06:45:45 +03:00
Move pickers under my leader key mode (space).
This commit is contained in:
parent
e166da2ab0
commit
dfc17becd5
@ -1853,3 +1853,23 @@ pub fn jump_backward(cx: &mut Context) {
|
|||||||
doc.set_selection(selection);
|
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),
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -244,8 +244,6 @@ pub fn default() -> Keymaps {
|
|||||||
ctrl!('u') => commands::half_page_up,
|
ctrl!('u') => commands::half_page_up,
|
||||||
ctrl!('d') => commands::half_page_down,
|
ctrl!('d') => commands::half_page_down,
|
||||||
|
|
||||||
ctrl!('p') => commands::file_picker,
|
|
||||||
ctrl!('b') => commands::buffer_picker,
|
|
||||||
KeyEvent {
|
KeyEvent {
|
||||||
code: KeyCode::Tab,
|
code: KeyCode::Tab,
|
||||||
modifiers: KeyModifiers::NONE
|
modifiers: KeyModifiers::NONE
|
||||||
@ -260,6 +258,8 @@ pub fn default() -> Keymaps {
|
|||||||
ctrl!('i') => commands::jump_forward, // TODO: ctrl-i conflicts tab
|
ctrl!('i') => commands::jump_forward, // TODO: ctrl-i conflicts tab
|
||||||
ctrl!('o') => commands::jump_backward,
|
ctrl!('o') => commands::jump_backward,
|
||||||
// ctrl!('s') => commands::save_selection,
|
// ctrl!('s') => commands::save_selection,
|
||||||
|
|
||||||
|
key!(' ') => commands::space_mode,
|
||||||
);
|
);
|
||||||
// TODO: decide whether we want normal mode to also be select mode (kakoune-like), or whether
|
// TODO: decide whether we want normal mode to also be select mode (kakoune-like), or whether
|
||||||
// we keep this separate select mode. More keys can fit into normal mode then, but it's weird
|
// we keep this separate select mode. More keys can fit into normal mode then, but it's weird
|
||||||
|
Loading…
Reference in New Issue
Block a user