aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-09 14:21:09 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-09 14:21:09 +0530
commit34b650aac876e87a08a78e86d10e74c9b9c278f3 (patch)
tree709097407a303a47d2ae0043fea80fffe90d0703
parent827f7fd662265631b07189c5dd389efb9a3e7c41 (diff)
downloadnnn-34b650aac876e87a08a78e86d10e74c9b9c278f3.tar.gz
Remap ^S and ^Q.
The replacement keys are: ^J - toggle du mode ^Y - quit The change is done because ^S, ^Q keybinds are lost in the following case: - start nnn - navigate to a different directory - spawn a shell - exit the shell The issue happens only with the 'special' keybinds like ^S, ^Q, ^Z... which get their original shell interpretation back. So we are replacing these 2 keybinds with 2 'non-special' combinations.
-rw-r--r--README.md4
-rw-r--r--nnn.14
-rw-r--r--nnn.c8
-rw-r--r--nnn.h4
4 files changed, 10 insertions, 10 deletions
diff --git a/README.md b/README.md
index 04bc859..77aba32 100644
--- a/README.md
+++ b/README.md
@@ -237,7 +237,7 @@ optional arguments:
n | Create new
^R | Rename entry
s | Toggle sort by size
- S, ^S | Toggle du mode
+ S, ^J | Toggle du mode
t | Toggle sort by mtime
! | Spawn SHELL in dir
e | Edit entry in EDITOR
@@ -249,7 +249,7 @@ optional arguments:
^L | Redraw, clear prompt
? | Help, settings
Q | Quit and cd
- q, ^Q | Quit
+ q, ^Y | Quit
```
Help & settings, file details, media info and archive listing are shown in the PAGER. Please use the PAGER-specific keys in these screens.
diff --git a/nnn.1 b/nnn.1
index 1cc7dcb..1bdde56 100644
--- a/nnn.1
+++ b/nnn.1
@@ -84,7 +84,7 @@ Create a new file or directory
Rename selected entry
.It Ic s
Toggle sort by file size
-.It Ic S, ^S
+.It Ic S, ^J
Toggle disk usage analyzer mode
.It Ic t
Toggle sort by time modified
@@ -108,7 +108,7 @@ Force a redraw, clear rename or filter prompt
Toggle help and settings screen
.It Ic Q
Quit and change directory
-.It Ic q, ^Q
+.It Ic q, ^Y
Quit
.El
.Pp
diff --git a/nnn.c b/nnn.c
index 33060f8..96358ff 100644
--- a/nnn.c
+++ b/nnn.c
@@ -988,9 +988,9 @@ filterentries(char *path)
case CONTROL('O'): // fallthrough
case CONTROL('B'): // fallthrough
case CONTROL('V'): // fallthrough
- case CONTROL('S'): // fallthrough
+ case CONTROL('J'): // fallthrough
case CONTROL('X'): // fallthrough
- case CONTROL('Q'):
+ case CONTROL('Y'):
goto end;
default:
/* Reset cur in case it's a repeat search */
@@ -1717,7 +1717,7 @@ show_help(char *path)
"en | Create new\n"
"d^R | Rename entry\n"
"es | Toggle sort by size\n"
- "aS, ^S | Toggle du mode\n"
+ "aS, ^J | Toggle du mode\n"
"et | Toggle sort by mtime\n"
"e! | Spawn SHELL in dir\n"
"ee | Edit entry in EDITOR\n"
@@ -1729,7 +1729,7 @@ show_help(char *path)
"d^L | Redraw, clear prompt\n"
"e? | Help, settings\n"
"eQ | Quit and cd\n"
- "aq, ^Q | Quit\n\n");
+ "aq, ^Y | Quit\n\n");
if (fd == -1)
return -1;
diff --git a/nnn.h b/nnn.h
index 37cfbed..06782bf 100644
--- a/nnn.h
+++ b/nnn.h
@@ -137,7 +137,7 @@ static struct key bindings[] = {
{ 's', SEL_FSIZE, "", "" },
/* Sort by total block count including dir contents */
{ 'S', SEL_BSIZE, "", "" },
- { CONTROL('S'), SEL_BSIZE, "", "" },
+ { CONTROL('J'), SEL_BSIZE, "", "" },
/* Toggle sort by time */
{ 't', SEL_MTIME, "", "" },
/* Redraw window */
@@ -163,5 +163,5 @@ static struct key bindings[] = {
{ 'Q', SEL_CDQUIT, "", "" },
/* Quit */
{ 'q', SEL_QUIT, "", "" },
- { CONTROL('Q'), SEL_QUIT, "", "" },
+ { CONTROL('Y'), SEL_QUIT, "", "" },
};