diff options
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 20 | ||||
-rw-r--r-- | helix-term/src/keymap/default.rs | 8 |
2 files changed, 28 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c3c7d224..2839f495 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -360,6 +360,10 @@ impl MappableCommand { jump_view_left, "Jump to the split to the left", jump_view_up, "Jump to the split above", jump_view_down, "Jump to the split below", + swap_view_right, "Swap with the split to the right", + swap_view_left, "Swap with the split to the left", + swap_view_up, "Swap with the split above", + swap_view_down, "Swap with the split below", transpose_view, "Transpose splits", rotate_view, "Goto next window", hsplit, "Horizontal bottom split", @@ -3864,6 +3868,22 @@ fn jump_view_down(cx: &mut Context) { cx.editor.focus_down() } +fn swap_view_right(cx: &mut Context) { + cx.editor.swap_right() +} + +fn swap_view_left(cx: &mut Context) { + cx.editor.swap_left() +} + +fn swap_view_up(cx: &mut Context) { + cx.editor.swap_up() +} + +fn swap_view_down(cx: &mut Context) { + cx.editor.swap_down() +} + fn transpose_view(cx: &mut Context) { cx.editor.transpose_view() } diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index 124517d4..a887f4b3 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -180,6 +180,10 @@ pub fn default() -> HashMap<Mode, Keymap> { "C-j" | "j" | "down" => jump_view_down, "C-k" | "k" | "up" => jump_view_up, "C-l" | "l" | "right" => jump_view_right, + "L" => swap_view_right, + "K" => swap_view_up, + "H" => swap_view_left, + "J" => swap_view_down, "n" => { "New split scratch buffer" "C-s" | "s" => hsplit_new, "C-v" | "v" => vsplit_new, @@ -236,6 +240,10 @@ pub fn default() -> HashMap<Mode, Keymap> { "C-j" | "j" | "down" => jump_view_down, "C-k" | "k" | "up" => jump_view_up, "C-l" | "l" | "right" => jump_view_right, + "H" => swap_view_left, + "J" => swap_view_down, + "K" => swap_view_up, + "L" => swap_view_right, "n" => { "New split scratch buffer" "C-s" | "s" => hsplit_new, "C-v" | "v" => vsplit_new, |