From 3f10473d30eec79e135ea74fa2bc4cc996426128 Mon Sep 17 00:00:00 2001 From: Roland Kovacs Date: Mon, 9 May 2022 21:12:01 +0200 Subject: Implement view swapping * add Tree::swap_split_in_direction() * add swap_view_{left,down,up,right} commands, bound to H,J,K,L respectively in the Window menu(s) * add test for view swapping --- helix-term/src/keymap/default.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'helix-term/src/keymap') 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 { "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 { "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, -- cgit v1.2.3-70-g09d2