diff --git a/README.md b/README.md index 22b9cde..f444f5d 100644 --- a/README.md +++ b/README.md @@ -595,7 +595,7 @@ force_tty = False #* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" -#* Set to True to enable "h,j,k,l" keys for directional control in lists. +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. vim_keys = False diff --git a/src/btop_config.cpp b/src/btop_config.cpp index c509a8a..8e55ad3 100644 --- a/src/btop_config.cpp +++ b/src/btop_config.cpp @@ -54,7 +54,7 @@ namespace Config { "#* Use withespace \" \" as separator between different presets.\n" "#* Example: \"cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty\""}, - {"vim_keys", "#* Set to True to enable \"h,j,k,l\" keys for directional control in lists.\n" + {"vim_keys", "#* Set to True to enable \"h,j,k,l,g,G\" keys for directional control in lists.\n" "#* Conflicting keys for h:\"help\" and k:\"kill\" is accessible while holding shift."}, {"rounded_corners", "#* Rounded corners on boxes, is ignored if TTY mode is ON."}, diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 59c9486..2fa300d 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -1070,11 +1070,11 @@ namespace Proc { if (selected > 0 and start >= numpids - select_max) selected = select_max; else start = clamp(start + select_max, 0, max(0, numpids - select_max)); } - else if (cmd_key == "home") { + else if (cmd_key == "home" or (vim_keys and cmd_key == "g")) { start = 0; if (selected > 0) selected = 1; } - else if (cmd_key == "end") { + else if (cmd_key == "end" or (vim_keys and cmd_key == "G")) { start = max(0, numpids - select_max); if (selected > 0) selected = select_max; } diff --git a/src/btop_input.cpp b/src/btop_input.cpp index 0694340..d21feec 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -416,7 +416,7 @@ namespace Input { Menu::show(Menu::Menus::SignalChoose); return; } - else if (is_in(key, "up", "down", "page_up", "page_down", "home", "end") or (vim_keys and is_in(key, "j", "k"))) { + else if (is_in(key, "up", "down", "page_up", "page_down", "home", "end") or (vim_keys and is_in(key, "j", "k", "g", "G"))) { proc_mouse_scroll: redraw = false; auto old_selected = Config::getI("proc_selected");