Add shortcut ^S to toggle du mode

This commit is contained in:
Arun Prakash Jana 2018-01-09 00:31:15 +05:30
parent f6fd15e088
commit 0a1776e18e
No known key found for this signature in database
GPG key ID: A75979F35C080412
4 changed files with 5 additions and 3 deletions

View file

@ -237,7 +237,7 @@ optional arguments:
n | Create new n | Create new
^R | Rename entry ^R | Rename entry
s | Toggle sort by size s | Toggle sort by size
S | Toggle du mode S, ^S | Toggle du mode
t | Toggle sort by mtime t | Toggle sort by mtime
! | Spawn SHELL in dir ! | Spawn SHELL in dir
e | Edit entry in EDITOR e | Edit entry in EDITOR

2
nnn.1
View file

@ -84,7 +84,7 @@ Create a new file or directory
Rename selected entry Rename selected entry
.It Ic s .It Ic s
Toggle sort by file size Toggle sort by file size
.It Ic S .It Ic S, ^S
Toggle disk usage analyzer mode Toggle disk usage analyzer mode
.It Ic t .It Ic t
Toggle sort by time modified Toggle sort by time modified

3
nnn.c
View file

@ -988,6 +988,7 @@ filterentries(char *path)
case CONTROL('O'): // fallthrough case CONTROL('O'): // fallthrough
case CONTROL('B'): // fallthrough case CONTROL('B'): // fallthrough
case CONTROL('V'): // fallthrough case CONTROL('V'): // fallthrough
case CONTROL('S'): // fallthrough
case CONTROL('X'): // fallthrough case CONTROL('X'): // fallthrough
case CONTROL('Q'): case CONTROL('Q'):
goto end; goto end;
@ -1716,7 +1717,7 @@ show_help(char *path)
"en | Create new\n" "en | Create new\n"
"d^R | Rename entry\n" "d^R | Rename entry\n"
"es | Toggle sort by size\n" "es | Toggle sort by size\n"
"eS | Toggle du mode\n" "aS, ^S | Toggle du mode\n"
"et | Toggle sort by mtime\n" "et | Toggle sort by mtime\n"
"e! | Spawn SHELL in dir\n" "e! | Spawn SHELL in dir\n"
"ee | Edit entry in EDITOR\n" "ee | Edit entry in EDITOR\n"

1
nnn.h
View file

@ -137,6 +137,7 @@ static struct key bindings[] = {
{ 's', SEL_FSIZE, "", "" }, { 's', SEL_FSIZE, "", "" },
/* Sort by total block count including dir contents */ /* Sort by total block count including dir contents */
{ 'S', SEL_BSIZE, "", "" }, { 'S', SEL_BSIZE, "", "" },
{ CONTROL('S'), SEL_BSIZE, "", "" },
/* Toggle sort by time */ /* Toggle sort by time */
{ 't', SEL_MTIME, "", "" }, { 't', SEL_MTIME, "", "" },
/* Redraw window */ /* Redraw window */