From 5c16b6aa7c033219f7cc90636011bce738dfad7b Mon Sep 17 00:00:00 2001 From: rabite Date: Tue, 16 Apr 2019 01:16:32 +0200 Subject: fix keybindings in holy-branch --- src/file_browser.rs | 9 ++++----- src/foldview.rs | 8 ++++---- src/listview.rs | 10 +++++----- src/proclist.rs | 10 +++++----- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/file_browser.rs b/src/file_browser.rs index b0fe845..cf3dbcc 100644 --- a/src/file_browser.rs +++ b/src/file_browser.rs @@ -1033,15 +1033,14 @@ impl Widget for FileBrowser { match key { Key::Char('/') => { self.turbo_cd()?; }, Key::Char('Q') => { self.quit_with_dir()?; }, - Key::Right | Key::Char('l') => { self.enter_dir()?; }, - Key::Char('L') => { self.open_bg()?; }, - Key::Left | Key::Char('h') => { self.go_back()?; }, + Key::Right | Key::Char('f') => { self.enter_dir()?; }, + Key::Char('F') => { self.open_bg()?; }, + Key::Left | Key::Char('b') => { self.go_back()?; }, Key::Char('-') => { self.goto_prev_cwd()?; }, Key::Char('`') => { self.goto_bookmark()?; }, Key::Char('m') => { self.add_bookmark()?; }, - Key::Char('w') => { self.show_procview()?; }, - Key::Char('g') => self.show_log()?, + Key::Char('l') => self.show_log()?, Key::Char('z') => self.run_subshell()?, Key::Char('c') => self.toggle_colums(), _ => { self.main_widget_mut()?.on_key(key)?; }, diff --git a/src/foldview.rs b/src/foldview.rs index 8e00209..4b3edfe 100644 --- a/src/foldview.rs +++ b/src/foldview.rs @@ -285,10 +285,10 @@ where fn on_key(&mut self, key: Key) -> HResult<()> { match key { - Key::Up | Key::Char('k') => self.move_up(), - Key::Char('K') => for _ in 0..10 { self.move_up() }, - Key::Char('J') => for _ in 0..10 { self.move_down() }, - Key::Down | Key::Char('j') => self.move_down(), + Key::Up | Key::Char('p') => self.move_up(), + Key::Char('P') => for _ in 0..10 { self.move_up() }, + Key::Char('N') => for _ in 0..10 { self.move_down() }, + Key::Down | Key::Char('n') => self.move_down(), Key::Char('t') => self.toggle_fold()?, Key::Char('l') => self.popup_finnished()?, _ => {} diff --git a/src/listview.rs b/src/listview.rs index f584597..c9b9b2c 100644 --- a/src/listview.rs +++ b/src/listview.rs @@ -61,13 +61,13 @@ impl Listable for ListView { fn on_key(&mut self, key: Key) -> HResult<()> { match key { - Key::Up | Key::Char('k') => { + Key::Up | Key::Char('p') => { self.move_up(); self.refresh()?; } - Key::Char('K') => { for _ in 0..10 { self.move_up() } self.refresh()?; } - Key::Char('J') => { for _ in 0..10 { self.move_down() } self.refresh()?; } - Key::Down | Key::Char('j') => { + Key::Char('P') => { for _ in 0..10 { self.move_up() } self.refresh()?; } + Key::Char('N') => { for _ in 0..10 { self.move_down() } self.refresh()?; } + Key::Down | Key::Char('n') => { self.move_down(); self.refresh()?; }, @@ -82,7 +82,7 @@ impl Listable for ListView { Key::Char(' ') => self.multi_select_file(), Key::Char('v') => self.invert_selection(), Key::Char('t') => self.toggle_tag()?, - Key::Char('H') => self.toggle_hidden(), + Key::Char('h') => self.toggle_hidden(), Key::Char('r') => self.reverse_sort(), Key::Char('s') => self.cycle_sort(), Key::Char('N') => self.select_next_mtime(), diff --git a/src/proclist.rs b/src/proclist.rs index eda40c1..b8e0524 100644 --- a/src/proclist.rs +++ b/src/proclist.rs @@ -562,16 +562,16 @@ impl Widget for ProcView { self.clear().log(); return Err(HError::PopupFinnished) } Key::Char('d') => { self.remove_proc()? } - Key::Char('K') => { self.get_listview_mut().kill_proc()? } - Key::Up | Key::Char('k') => { + Key::Char('k') => { self.get_listview_mut().kill_proc()? } + Key::Up | Key::Char('p') => { self.get_listview_mut().move_up(); } - Key::Down | Key::Char('j') => { + Key::Down | Key::Char('n') => { self.get_listview_mut().move_down(); } Key::Char('f') => { self.toggle_follow().log(); } - Key::Ctrl('j') => { self.scroll_down().log(); }, - Key::Ctrl('k') => { self.scroll_up().log(); }, + Key::Ctrl('n') => { self.scroll_down().log(); }, + Key::Ctrl('p') => { self.scroll_up().log(); }, Key::Ctrl('v') => { self.page_down().log(); }, Key::Alt('v') => { self.page_up().log(); }, Key::Char('>') => { self.scroll_bottom().log(); }, -- cgit v1.2.3