diff options
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 22 | ||||
-rw-r--r-- | helix-term/src/keymap.rs | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 7a1643fe..24fb1709 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1642,3 +1642,25 @@ pub fn match_brackets(cx: &mut Context) { }; } } + +// + +pub fn jump_forward(cx: &mut Context) { + let count = cx.count; + let view = cx.view(); + + if let Some((id, selection)) = view.jumps.forward(count) { + view.first_line = 0; + view.doc = *id; + }; +} + +pub fn jump_backward(cx: &mut Context) { + let count = cx.count; + let view = cx.view(); + + if let Some((id, selection)) = view.jumps.backward(count) { + view.first_line = 0; + view.doc = *id; + }; +} diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index bd1b31ef..824d469d 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -253,6 +253,9 @@ pub fn default() -> Keymaps { shift!('K') => commands::hover, // z family for save/restore/combine from/to sels from register + + ctrl!('i') => commands::jump_forward, // TODO: ctrl-i conflicts tab + ctrl!('o') => commands::jump_backward, ); // 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 |