Warning: file_exists(): open_basedir restriction in effect. File(/srv/http/vhosts/aur.archlinux.org/public/web/locale//en/LC_MESSAGES/aurweb.mo) is not within the allowed path(s): (/srv/http/vhosts/aur-dev.archlinux.org/:/etc/aurweb/) in /srv/http/vhosts/aur-dev.archlinux.org/public/web/lib/streams.php on line 90
AUR (en) - htop-vim-git

Notice: Undefined variable: name in /srv/http/vhosts/aur-dev.archlinux.org/public/web/lib/pkgfuncs.inc.php on line 248

Package Details: htop-vim-git 899.7f9c82f-1

Git Clone URL: https://aur-dev.archlinux.org/htop-vim-git.git (read-only)
Package Base: htop-vim-git
Description: Interactive text-mode process viewer. Patched for vim keybindings
Upstream URL: https://github.com/hishamhm/htop
Licenses: GPL
Conflicts: htop, htop-git
Provides: htop
Submitter: KoffeinFlummi
Maintainer: KoffeinFlummi
Last Packager: KoffeinFlummi
Votes: 6
Popularity: 0.567548
First Submitted: 2015-08-06 05:38
Last Updated: 2016-11-21 12:44

Dependencies (5)

Required by (7)

Sources (2)

Latest Comments

1 2 3 Next › Last »

pablo1107 commented on 2017-01-27 13:14

I don't know why it didn't install for itself but you can manually install the package if this happens.

==> Compilación terminada: htop-vim-git 930.6141edc-1 (vie ene 27 10:09:20 ART 2017)
cargando los paquetes…
error: '/var/cache/pacman/pkg/htop-vim-git-930.6141edc-1-x86_64.pkg.tar.xz': objetivo duplicado
┌─╼[/var/cache/pacman/pkg]
└────╼ ls | grep htop
htop-vim-git-928.8af4d9f-1-x86_64.pkg.tar.xz
htop-vim-git-930.6141edc-1-x86_64.pkg.tar.xz
┌─╼[/var/cache/pacman/pkg]
└────╼ sudo pacman -U htop-vim-git-930.6141edc-1-x86_64.pkg.tar.xz

mazinght commented on 2016-12-31 22:35

Is this currently working fine for others? Vanilla htop renders fine on my terminal, but with this package it has gibberish everywhere it was supposed to have text except for the bar on the bottom with the F-bindings, the Help view and the part on the top with system info. I tried it with an empty .Xresources and had the same result.

zanculmarktum commented on 2016-11-22 03:07

What about https://github.com/hishamhm/htop/releases/tag/2.0.2 ?
Instead of cloning, I think it is better to download a specific version, so your .patch file won't be incompatible when the repository got updated.
I mean something like htop-vim (without -git).

KoffeinFlummi commented on 2016-11-21 12:45

Sorry for the delay guys, I updated the patch.

zanculmarktum commented on 2016-11-14 01:54

@eyolf: here's the fix.

Replace the contents of vim-keybindings.patch file with these:

=== BEGIN ===

diff --git a/Action.c b/Action.c
index ee34a4b..b0c8013 100644
--- a/Action.c
+++ b/Action.c
@@ -382,7 +382,7 @@ static Htop_Reaction actionRedraw() {
}

static 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" },
@@ -403,7 +403,7 @@ static 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: ", .info = "kill process/tagged processes" },
{ .key = " F7 ]: ", .info = "higher priority (root only)" },
{ .key = " F8 [: ", .info = "lower priority (+ nice)" },
#if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY)
@@ -411,11 +411,11 @@ static 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 = " ", .info = "" },
{ .key = " F2 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 }
};
@@ -543,6 +543,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;
@@ -551,7 +552,7 @@ void Action_setBindings(Htop_Action* keys) {
keys['q'] = actionQuit;
keys['a'] = actionSetAffinity;
keys[KEY_F(9)] = actionKill;
- keys['k'] = actionKill;
+ keys['x'] = actionKill;
keys[KEY_RECLICK] = actionExpandOrCollapse;
keys['+'] = actionExpandOrCollapse;
keys['='] = actionExpandOrCollapse;
@@ -561,12 +562,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;
diff --git a/Panel.c b/Panel.c
index 8c4d44f..ea59346 100644
--- a/Panel.c
+++ b/Panel.c
@@ -376,10 +376,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;
@@ -394,23 +396,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 -= MAX(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 = MAX(0, this->scrollV - this->h + 1);
this->needsRedraw = true;
break;
case KEY_NPAGE:
+ case KEY_CTRL('F'):
this->selected += (this->h - 1);
this->scrollV = MAX(0, MIN(Vector_size(this->items) - this->h,
this->scrollV + this->h - 1));
@@ -432,9 +444,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'):
diff --git a/README b/README
index 33a8739..e07bd58 100644
--- a/README
+++ b/README
@@ -17,6 +17,44 @@ but we also have code for running under FreeBSD and Mac OS X
This software has evolved considerably over the years,
and is reasonably complete, but there is always room for improvement.

+Vim keybindings
+----------------
+
+These are the keybindings added in this fork of htop:
+
+```
+ g to the top (gg in vim)
+
+ <C-b> up 1 page
+
+ <C-u> up 1/2 page
+
+ k
+
+h l one character
+
+ j
+
+ <C-d> down 1/2 page
+
+ <C-f> down 1 page
+
+ G to the end
+
+--------------------------------------------------
+
+ o Expand/collapse (like in NERDTree)
+```
+
+In order to accomodate these keybindings, the following changes
+were made to the original keybindings:
+
+* Ctrl+F and Ctrt+B can now longer be used to navigate horizontally
+* 'h' can no longer be used to access the help, leaving Ctrl+F1 & '?'
+* 'k' can no longer be used to kill processes, being replaced with 'x'
+* 'l' can no longer be used to list open files, being replaced with 'L'
+
+
Comparison between `htop` and classic `top`
-------------------------------------------

diff --git a/ScreenManager.c b/ScreenManager.c
index 05e1c02..df2ac4a 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -279,7 +279,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;
}
@@ -293,7 +293,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;

=== END ===

and replace PKGBUILD with these:

from:

sha256sums=('SKIP'
'76073636b87f43cece2072a7c9944768535c147f1b36843345ebba91073adfec')

to:

sha256sums=('SKIP'
'SKIP')

eyolf commented on 2016-11-03 18:05

Bump:

==> Starting prepare()...
-> Applying /home/eyolf/.cache/pacaur/htop-vim-git/src/vim-keybindings.patch
patching file Action.c
patching file Panel.c
Hunk #2 FAILED at 396.
Hunk #3 succeeded at 434 (offset 1 line).
1 out of 3 hunks FAILED -- saving rejects to file Panel.c.rej
patching file README
patching file ScreenManager.c
==> ERROR: A failure occurred in prepare().
Aborting...

mkoskar commented on 2016-09-15 20:07

Patch doesn't apply:

Hunk #2 FAILED at 396.
1 out of 3 hunks FAILED -- saving rejects to file Panel.c.rej

KoffeinFlummi commented on 2016-06-23 23:24

Fixed.

autrimpo commented on 2016-06-23 15:47

Building fails:

==> Starting prepare()...
-> Applying /home/autrimpo/.cache/pacaur/htop-vim-git/src/vim-keybindings.patch
patching file Action.c
patching file MainPanel.c
Hunk #1 FAILED at 104.
1 out of 1 hunk FAILED -- saving rejects to file MainPanel.c.rej
patching file Panel.c
Hunk #1 FAILED at 86.
Hunk #2 FAILED at 372.
Hunk #3 FAILED at 394.
Hunk #4 succeeded at 431 with fuzz 1.
3 out of 4 hunks FAILED -- saving rejects to file Panel.c.rej
patching file Panel.h
Hunk #1 FAILED at 74.
1 out of 1 hunk FAILED -- saving rejects to file Panel.h.rej
patching file README
patching file ScreenManager.c
Hunk #1 FAILED at 279.
Hunk #2 FAILED at 290.
2 out of 2 hunks FAILED -- saving rejects to file ScreenManager.c.rej
==> ERROR: A failure occurred in prepare().
Aborting...
:: failed to build htop-vim-git package(s)

KoffeinFlummi commented on 2016-03-11 19:11

Fixed, thanks.