diff options
author | icasdri | 2020-11-02 20:27:49 -0500 |
---|---|---|
committer | icasdri | 2020-11-02 20:27:49 -0500 |
commit | 8c799c94983ead1f316973e766ba5d0cf5483a1f (patch) | |
tree | c3fbfb8780bf090b1a435175415744471cbdeb33 /vim-keybindings.patch | |
parent | 79296f4e9295f535f0bff33f0e5274e7ec774b22 (diff) | |
download | aur-8c799c94983ead1f316973e766ba5d0cf5483a1f.tar.gz |
fix vim keybinding breakage (upstream moved some functions around), remove README changes (unnecessary source of patch failures), remove x/d kill distinction (just accept both), update build to match Arch upstream
Diffstat (limited to 'vim-keybindings.patch')
-rw-r--r-- | vim-keybindings.patch | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/vim-keybindings.patch b/vim-keybindings.patch new file mode 100644 index 000000000000..c14dcf9e760c --- /dev/null +++ b/vim-keybindings.patch @@ -0,0 +1,160 @@ +--- a/Action.c ++++ b/Action.c +@@ -404,7 +404,7 @@ static Htop_Reaction actionTogglePauseProcessUpdate(State *st) { + } + + static const struct { const char* key; const char* info; } helpLeft[] = { +- { .key = " Arrows: ", .info = "scroll process list" }, ++ { .key = " hjkl: ", .info = "scroll process list" }, + { .key = " Digits: ", .info = "incremental PID search" }, + { .key = " F3 /: ", .info = "incremental name search" }, + { .key = " F4 \\: ",.info = "incremental name filtering" }, +@@ -426,7 +426,7 @@ static const struct { const char* key; const char* info; } helpRight[] = { + { .key = " Space: ", .info = "tag process" }, + { .key = " c: ", .info = "tag process and its children" }, + { .key = " U: ", .info = "untag all processes" }, +- { .key = " F9 k: ", .info = "kill process/tagged processes" }, ++ { .key = " F9 x d: ", .info = "kill process/tagged processes" }, + { .key = " F7 ]: ", .info = "higher priority (root only)" }, + { .key = " F8 [: ", .info = "lower priority (+ nice)" }, + #if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY)) +@@ -434,11 +434,11 @@ static const struct { const char* key; const char* info; } helpRight[] = { + #endif + { .key = " e: ", .info = "show process environment" }, + { .key = " i: ", .info = "set IO priority" }, +- { .key = " l: ", .info = "list open files with lsof" }, ++ { .key = " L: ", .info = "list open files with lsof" }, + { .key = " s: ", .info = "trace syscalls with strace" }, + { .key = " w: ", .info = "wrap process command in multiple lines" }, + { .key = " F2 C S: ", .info = "setup" }, +- { .key = " F1 h: ", .info = "show this help screen" }, ++ { .key = " F1 ?: ", .info = "show this help screen" }, + { .key = " F10 q: ", .info = "quit" }, + { .key = NULL, .info = NULL } + }; +@@ -601,6 +601,7 @@ void Action_setBindings(Htop_Action* keys) { + keys['I'] = actionInvertSortOrder; + keys[KEY_F(6)] = actionExpandCollapseOrSortColumn; + keys[KEY_F(18)] = actionExpandCollapseOrSortColumn; ++ keys['o'] = actionExpandCollapseOrSortColumn; + keys['<'] = actionSetSortColumn; + keys[','] = actionSetSortColumn; + keys['>'] = actionSetSortColumn; +@@ -609,7 +610,8 @@ void Action_setBindings(Htop_Action* keys) { + keys['q'] = actionQuit; + keys['a'] = actionSetAffinity; + keys[KEY_F(9)] = actionKill; +- keys['k'] = actionKill; ++ keys['x'] = actionKill; ++ keys['d'] = actionKill; + keys[KEY_RECLICK] = actionExpandOrCollapse; + keys['+'] = actionExpandOrCollapse; + keys['='] = actionExpandOrCollapse; +@@ -620,12 +622,11 @@ void Action_setBindings(Htop_Action* keys) { + keys['S'] = actionSetup; + keys['C'] = actionSetup; + keys[KEY_F(2)] = actionSetup; +- keys['l'] = actionLsof; ++ keys['L'] = actionLsof; + keys['s'] = actionStrace; + keys[' '] = actionTag; + keys['\014'] = actionRedraw; // Ctrl+L + keys[KEY_F(1)] = actionHelp; +- keys['h'] = actionHelp; + keys['?'] = actionHelp; + keys['U'] = actionUntagAll; + keys['c'] = actionTagAllChildren; +--- a/CategoriesPanel.c ++++ b/CategoriesPanel.c +@@ -77,6 +77,8 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) { + case KEY_CTRL('N'): + case KEY_NPAGE: + case KEY_PPAGE: ++ case 'g': ++ case 'G': + case KEY_HOME: + case KEY_END: { + int previous = selected; +--- a/Panel.c ++++ b/Panel.c +@@ -319,10 +319,12 @@ bool Panel_onKey(Panel* this, int key) { + int size = Vector_size(this->items); + switch (key) { + case KEY_DOWN: ++ case 'j': + case KEY_CTRL('N'): + this->selected++; + break; + case KEY_UP: ++ case 'k': + case KEY_CTRL('P'): + this->selected--; + break; +@@ -337,23 +339,33 @@ bool Panel_onKey(Panel* this, int key) { + break; + #endif + case KEY_LEFT: +- case KEY_CTRL('B'): ++ case 'h': + if (this->scrollH > 0) { + this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0); + this->needsRedraw = true; + } + break; + case KEY_RIGHT: +- case KEY_CTRL('F'): ++ case 'l': + this->scrollH += CRT_scrollHAmount; + this->needsRedraw = true; + break; ++ case KEY_CTRL('U'): ++ this->selected -= (this->h - 1) / 2; ++ this->needsRedraw = true; ++ break; ++ case KEY_CTRL('D'): ++ this->selected += (this->h - 1) / 2; ++ this->needsRedraw = true; ++ break; + case KEY_PPAGE: ++ case KEY_CTRL('B'): + this->selected -= (this->h - 1); + this->scrollV = MAXIMUM(0, this->scrollV - this->h + 1); + this->needsRedraw = true; + break; + case KEY_NPAGE: ++ case KEY_CTRL('F'): + this->selected += (this->h - 1); + this->scrollV = MAXIMUM(0, MINIMUM(Vector_size(this->items) - this->h, + this->scrollV + this->h - 1)); +@@ -375,9 +387,11 @@ bool Panel_onKey(Panel* this, int key) { + break; + } + case KEY_HOME: ++ case 'g': + this->selected = 0; + break; + case KEY_END: ++ case 'G': + this->selected = size - 1; + break; + case KEY_CTRL('A'): +--- a/ScreenManager.c ++++ b/ScreenManager.c +@@ -257,7 +257,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { + continue; + } + case KEY_LEFT: +- case KEY_CTRL('B'): ++ case 'h': + if (this->panelCount < 2) { + goto defaultHandler; + } +@@ -271,7 +271,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { + goto tryLeft; + break; + case KEY_RIGHT: +- case KEY_CTRL('F'): ++ case 'l': + case 9: + if (this->panelCount < 2) { + goto defaultHandler; |