summarylogtreecommitdiffstats
path: root/vim-keybindings.patch
blob: 9e3e87d3f49662b286b43bcc61a93a3a8cfecc27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
diff --git a/Action.c b/Action.c
index 4049a952..9ef91740 100644
--- a/Action.c
+++ b/Action.c
@@ -894,6 +894,7 @@ void Action_setBindings(Htop_Action* keys) {
    keys['/'] = actionIncSearch;
    keys['<'] = actionSetSortColumn;
    keys['='] = actionExpandOrCollapse;
+   keys['o'] = actionExpandOrCollapse;
    keys['>'] = actionSetSortColumn;
    keys['?'] = actionHelp;
    keys['C'] = actionSetup;
@@ -920,9 +921,9 @@ void Action_setBindings(Htop_Action* keys) {
    keys['a'] = actionSetAffinity;
    keys['c'] = actionTagAllChildren;
    keys['e'] = actionShowEnvScreen;
-   keys['h'] = actionHelp;
-   keys['k'] = actionKill;
-   keys['l'] = actionLsof;
+   //keys['h'] = actionHelp;
+   keys['x'] = actionKill;
+   keys['L'] = actionLsof;
    keys['m'] = actionToggleMergedCommand;
    keys['p'] = actionToggleProgramPath;
    keys['q'] = actionQuit;
@@ -930,7 +931,7 @@ void Action_setBindings(Htop_Action* keys) {
    keys['t'] = actionToggleTreeView;
    keys['u'] = actionFilterByUser;
    keys['w'] = actionShowCommandScreen;
-   keys['x'] = actionShowLocks;
+   keys['X'] = actionShowLocks;
    keys[KEY_F(1)] = actionHelp;
    keys[KEY_F(2)] = actionSetup;
    keys[KEY_F(3)] = actionIncSearch;
diff --git a/AvailableMetersPanel.c b/AvailableMetersPanel.c
index 9a1d367c..f1c07175 100644
--- a/AvailableMetersPanel.c
+++ b/AvailableMetersPanel.c
@@ -59,7 +59,7 @@ static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) {
 
    switch (ch) {
       case KEY_F(5):
-      case 'l':
+      //case 'l':
       case 'L':
          AvailableMetersPanel_addMeter(header, this->meterPanels[0], Platform_meterTypes[type], param, 0);
          result = HANDLED;
@@ -69,7 +69,7 @@ static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) {
       case 0x0d:
       case KEY_ENTER:
       case KEY_F(6):
-      case 'r':
+      //case 'r':
       case 'R':
          AvailableMetersPanel_addMeter(header, this->meterPanels[this->columns - 1], Platform_meterTypes[type], param, this->columns - 1);
          result = (KEY_LEFT << 16) | SYNTH_KEY;
diff --git a/CategoriesPanel.c b/CategoriesPanel.c
index 64a3f062..b67711cc 100644
--- a/CategoriesPanel.c
+++ b/CategoriesPanel.c
@@ -129,11 +129,19 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_UP:
+      case 'k':
       case KEY_CTRL('P'):
       case KEY_DOWN:
+      case 'j':
       case KEY_CTRL('N'):
       case KEY_NPAGE:
+      case KEY_CTRL('D'):
+      case KEY_CTRL('F'):
       case KEY_PPAGE:
+      case KEY_CTRL('B'):
+      case KEY_CTRL('U'):
+      case 'g':
+      case 'G':
       case KEY_HOME:
       case KEY_END: {
          int previous = selected;
diff --git a/ColumnsPanel.c b/ColumnsPanel.c
index 66625666..5a8c5951 100644
--- a/ColumnsPanel.c
+++ b/ColumnsPanel.c
@@ -57,6 +57,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
          }
          break;
       case KEY_UP:
+      case 'k':
          if (!this->moving)
             break;
          /* else fallthrough */
@@ -68,6 +69,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_DOWN:
+      case 'j':
          if (!this->moving)
             break;
          /* else fallthrough */
diff --git a/MetersPanel.c b/MetersPanel.c
index 2678fb2f..8d174f9f 100644
--- a/MetersPanel.c
+++ b/MetersPanel.c
@@ -117,6 +117,7 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
          break;
       }
       case KEY_UP:
+      case 'k':
          if (!this->moving)
             break;
          /* else fallthrough */
@@ -128,6 +129,7 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_DOWN:
+      case 'j':
          if (!this->moving)
             break;
          /* else fallthrough */
@@ -139,6 +141,7 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_RIGHT:
+      case 'l':
          sideMove = moveToNeighbor(this, this->rightNeighbor, selected);
          if (this->moving && !sideMove) {
             // lock user here until it exits positioning-mode
@@ -148,6 +151,7 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
          // let ScreenManager handle focus.
          break;
       case KEY_LEFT:
+      case 'h':
          sideMove = moveToNeighbor(this, this->leftNeighbor, selected);
          if (this->moving && !sideMove) {
             result = HANDLED;
diff --git a/Panel.c b/Panel.c
index 4784a658..7a0d5f39 100644
--- a/Panel.c
+++ b/Panel.c
@@ -360,6 +360,7 @@ bool Panel_onKey(Panel* this, int key) {
 
    switch (key) {
       case KEY_DOWN:
+      case 'j':
       case KEY_CTRL('N'):
       #ifdef KEY_C_DOWN
       case KEY_C_DOWN:
@@ -368,6 +369,7 @@ bool Panel_onKey(Panel* this, int key) {
          break;
 
       case KEY_UP:
+      case 'k':
       case KEY_CTRL('P'):
       #ifdef KEY_C_UP
       case KEY_C_UP:
@@ -376,7 +378,8 @@ bool Panel_onKey(Panel* this, int key) {
          break;
 
       case KEY_LEFT:
-      case KEY_CTRL('B'):
+      case 'h':
+      //case KEY_CTRL('B'):
          if (this->scrollH > 0) {
             this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0);
             this->needsRedraw = true;
@@ -384,19 +387,30 @@ bool Panel_onKey(Panel* this, int key) {
          break;
 
       case KEY_RIGHT:
-      case KEY_CTRL('F'):
+      case 'l':
+      //case KEY_CTRL('F'):
          this->scrollH += CRT_scrollHAmount;
          this->needsRedraw = true;
          break;
 
       case KEY_PPAGE:
+      case KEY_CTRL('B'):
          PANEL_SCROLL(-(this->h - Panel_headerHeight(this)));
          break;
 
+      case KEY_CTRL('U'):
+         PANEL_SCROLL(-(this->h - Panel_headerHeight(this))/2);
+         break;
+
       case KEY_NPAGE:
+      case KEY_CTRL('F'):
          PANEL_SCROLL(+(this->h - Panel_headerHeight(this)));
          break;
 
+      case KEY_CTRL('D'):
+         PANEL_SCROLL(+(this->h - Panel_headerHeight(this))/2);
+         break;
+
       case KEY_WHEELUP:
          PANEL_SCROLL(-CRT_scrollWheelVAmount);
          break;
@@ -406,10 +420,12 @@ 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;
 
diff --git a/ScreenManager.c b/ScreenManager.c
index e7e82e1d..9318b7c5 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -324,9 +324,11 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
 
       switch (ch) {
          case KEY_ALT('H'): ch = KEY_LEFT; break;
+         case 'h': ch = KEY_LEFT; break;
          case KEY_ALT('J'): ch = KEY_DOWN; break;
          case KEY_ALT('K'): ch = KEY_UP; break;
          case KEY_ALT('L'): ch = KEY_RIGHT; break;
+         case 'l': ch = KEY_RIGHT; break;
       }
 
       redraw = true;
diff --git a/ScreenTabsPanel.c b/ScreenTabsPanel.c
index e48e5fb8..6f152ce6 100644
--- a/ScreenTabsPanel.c
+++ b/ScreenTabsPanel.c
@@ -81,9 +81,15 @@ static HandlerResult ScreenTabsPanel_eventHandler(Panel* super, int ch) {
          /* pass onto the Names panel for creating new screen */
          return ScreenNamesPanel_eventHandlerNormal(&this->names->super, ch);
       case KEY_UP:
+      case 'k':
       case KEY_DOWN:
+      case 'j':
       case KEY_NPAGE:
+      case KEY_CTRL('D'):
+      case KEY_CTRL('F'):
       case KEY_PPAGE:
+      case KEY_CTRL('B'):
+      case KEY_CTRL('U'):
       case KEY_HOME:
       case KEY_END: {
          int previous = selected;
diff --git a/ScreensPanel.c b/ScreensPanel.c
index 4138066b..6c7c4801 100644
--- a/ScreensPanel.c
+++ b/ScreensPanel.c
@@ -194,7 +194,11 @@ static HandlerResult ScreensPanel_eventHandlerNormal(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_NPAGE:
+      case KEY_CTRL('D'):
+      case KEY_CTRL('F'):
       case KEY_PPAGE:
+      case KEY_CTRL('B'):
+      case KEY_CTRL('U'):
       case KEY_HOME:
       case KEY_END:
          Panel_onKey(super, ch);
@@ -214,6 +218,7 @@ static HandlerResult ScreensPanel_eventHandlerNormal(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_UP:
+      case 'k':
          if (!this->moving) {
             Panel_onKey(super, ch);
             break;
@@ -227,6 +232,7 @@ static HandlerResult ScreensPanel_eventHandlerNormal(Panel* super, int ch) {
          result = HANDLED;
          break;
       case KEY_DOWN:
+      case 'j':
          if (!this->moving) {
             Panel_onKey(super, ch);
             break;