mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-15 18:18:41 -09:00
Added some keybindings and changed 'h' to 'e' in browser
This commit is contained in:
parent
adaf8a6098
commit
06cab8cc30
5 changed files with 25 additions and 10 deletions
|
|
@ -8,6 +8,7 @@ git - ?
|
||||||
- Properly display MiB units instead of MB (IEEE 1541 - bug #2831412)
|
- Properly display MiB units instead of MB (IEEE 1541 - bug #2831412)
|
||||||
- Link to ncursesw when available
|
- Link to ncursesw when available
|
||||||
- Improved support for non-ASCII characters
|
- Improved support for non-ASCII characters
|
||||||
|
- VIM keybindings for browsing through the tree (#2788249, #1880622)
|
||||||
|
|
||||||
1.5 - 2009-05-02
|
1.5 - 2009-05-02
|
||||||
- Fixed incorrect apparent size on directory refresh
|
- Fixed incorrect apparent size on directory refresh
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,13 @@ should be seperated by a newline.
|
||||||
\fB?\fP
|
\fB?\fP
|
||||||
Show help + keys + about screen
|
Show help + keys + about screen
|
||||||
.TP
|
.TP
|
||||||
\fBup/down\fP
|
\fBup, down j, k\fP
|
||||||
Cycle through the items
|
Cycle through the items
|
||||||
.TP
|
.TP
|
||||||
\fBright/enter\fP
|
\fBright, enter, l\fP
|
||||||
Open selected directory
|
Open selected directory
|
||||||
.TP
|
.TP
|
||||||
\fBleft\fP
|
\fBleft, <, h\fP
|
||||||
Go to parent directory
|
Go to parent directory
|
||||||
.TP
|
.TP
|
||||||
\fBn\fP
|
\fBn\fP
|
||||||
|
|
@ -74,7 +74,7 @@ Toggle between showing percentage, graph, both, or none. Percentage
|
||||||
is relative to the size of the current directory, graph is relative
|
is relative to the size of the current directory, graph is relative
|
||||||
to the largest item in the current directory.
|
to the largest item in the current directory.
|
||||||
.TP
|
.TP
|
||||||
\fBh\fP
|
\fBe\fP
|
||||||
Show/hide 'hidden' or 'excluded' files and directories. Please note that
|
Show/hide 'hidden' or 'excluded' files and directories. Please note that
|
||||||
even though you can't see the hidden files and directories, they are still
|
even though you can't see the hidden files and directories, they are still
|
||||||
there and they are still included in the directory sizes. If you suspect
|
there and they are still included in the directory sizes. If you suspect
|
||||||
|
|
|
||||||
|
|
@ -347,9 +347,11 @@ int browse_key(int ch) {
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
/* selecting items */
|
/* selecting items */
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
|
case 'k':
|
||||||
browse_key_sel(-1);
|
browse_key_sel(-1);
|
||||||
break;
|
break;
|
||||||
case KEY_DOWN:
|
case KEY_DOWN:
|
||||||
|
case 'j':
|
||||||
browse_key_sel(1);
|
browse_key_sel(1);
|
||||||
break;
|
break;
|
||||||
case KEY_HOME:
|
case KEY_HOME:
|
||||||
|
|
@ -383,7 +385,7 @@ int browse_key(int ch) {
|
||||||
sort++;
|
sort++;
|
||||||
nonfo++;
|
nonfo++;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'e':
|
||||||
toggle(flags, BF_HIDE);
|
toggle(flags, BF_HIDE);
|
||||||
browse_key_sel(0);
|
browse_key_sel(0);
|
||||||
nonfo++;
|
nonfo++;
|
||||||
|
|
@ -401,6 +403,7 @@ int browse_key(int ch) {
|
||||||
/* browsing */
|
/* browsing */
|
||||||
case 10:
|
case 10:
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
|
case 'l':
|
||||||
for(n=browse_dir; n!=NULL; n=n->next)
|
for(n=browse_dir; n!=NULL; n=n->next)
|
||||||
if(n->flags & FF_BSEL)
|
if(n->flags & FF_BSEL)
|
||||||
break;
|
break;
|
||||||
|
|
@ -416,6 +419,8 @@ int browse_key(int ch) {
|
||||||
nonfo++;
|
nonfo++;
|
||||||
break;
|
break;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
case 'h':
|
||||||
|
case '<':
|
||||||
if(browse_dir != NULL && browse_dir->parent->parent != NULL) {
|
if(browse_dir != NULL && browse_dir->parent->parent != NULL) {
|
||||||
browse_dir = browse_dir->parent->parent->sub;
|
browse_dir = browse_dir->parent->parent->sub;
|
||||||
sort++;
|
sort++;
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,12 @@ int delete_key(int ch) {
|
||||||
if(state == DS_CONFIRM)
|
if(state == DS_CONFIRM)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
case 'h':
|
||||||
if(--seloption < 0)
|
if(--seloption < 0)
|
||||||
seloption = 0;
|
seloption = 0;
|
||||||
break;
|
break;
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
|
case 'l':
|
||||||
if(++seloption > 2)
|
if(++seloption > 2)
|
||||||
seloption = 2;
|
seloption = 2;
|
||||||
break;
|
break;
|
||||||
|
|
@ -139,10 +141,12 @@ int delete_key(int ch) {
|
||||||
else if(state == DS_FAILED)
|
else if(state == DS_FAILED)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
case 'h':
|
||||||
if(--seloption < 0)
|
if(--seloption < 0)
|
||||||
seloption = 0;
|
seloption = 0;
|
||||||
break;
|
break;
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
|
case 'l':
|
||||||
if(++seloption > 2)
|
if(++seloption > 2)
|
||||||
seloption = 2;
|
seloption = 2;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
15
src/help.c
15
src/help.c
|
|
@ -32,19 +32,20 @@
|
||||||
int page, start;
|
int page, start;
|
||||||
|
|
||||||
|
|
||||||
#define KEYS 13
|
#define KEYS 14
|
||||||
char *keys[KEYS*2] = {
|
char *keys[KEYS*2] = {
|
||||||
/*|----key----| |----------------description----------------|*/
|
/*|----key----| |----------------description----------------|*/
|
||||||
"up/down", "Cycle through the items",
|
"up, k", "Move cursor up",
|
||||||
"right/enter", "Open directory",
|
"down, j", "Move cursor down",
|
||||||
"left", "Previous directory",
|
"right/enter", "Open selected directory",
|
||||||
|
"left, <, h", "Open parent directory",
|
||||||
"n", "Sort by name (ascending/descending)",
|
"n", "Sort by name (ascending/descending)",
|
||||||
"s", "Sort by size (ascending/descending)",
|
"s", "Sort by size (ascending/descending)",
|
||||||
"d", "Delete selected file or directory",
|
"d", "Delete selected file or directory",
|
||||||
"t", "Toggle dirs before files when sorting",
|
"t", "Toggle dirs before files when sorting",
|
||||||
"g", "Show percentage and/or graph",
|
"g", "Show percentage and/or graph",
|
||||||
"a", "Toggle between apparent size and disk usage",
|
"a", "Toggle between apparent size and disk usage",
|
||||||
"h", "Show/hide hidden or excluded files",
|
"e", "Show/hide hidden or excluded files",
|
||||||
"i", "Show information about selected item",
|
"i", "Show information about selected item",
|
||||||
"r", "Recalculate the current directory",
|
"r", "Recalculate the current directory",
|
||||||
"q", "Quit ncdu"
|
"q", "Quit ncdu"
|
||||||
|
|
@ -166,22 +167,26 @@ int help_key(int ch) {
|
||||||
break;
|
break;
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
case KEY_NPAGE:
|
case KEY_NPAGE:
|
||||||
|
case 'l':
|
||||||
if(++page > 3)
|
if(++page > 3)
|
||||||
page = 3;
|
page = 3;
|
||||||
start = 0;
|
start = 0;
|
||||||
break;
|
break;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
case KEY_PPAGE:
|
case KEY_PPAGE:
|
||||||
|
case 'h':
|
||||||
if(--page < 1)
|
if(--page < 1)
|
||||||
page = 1;
|
page = 1;
|
||||||
start = 0;
|
start = 0;
|
||||||
break;
|
break;
|
||||||
case KEY_DOWN:
|
case KEY_DOWN:
|
||||||
case ' ':
|
case ' ':
|
||||||
|
case 'j':
|
||||||
if(start < KEYS-10)
|
if(start < KEYS-10)
|
||||||
start++;
|
start++;
|
||||||
break;
|
break;
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
|
case 'k':
|
||||||
if(start > 0)
|
if(start > 0)
|
||||||
start--;
|
start--;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue