aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-08-25 06:05:10 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-08-25 06:05:10 +0530
commit2c909993815f33be1796d5f2bc6d3c65a5404fe2 (patch)
tree148e7a8827e846982da0a529df54a91e3c69dee2
parent871685f7cafef26a17ad0d60d93bc3bdb152fcc8 (diff)
downloadnnn-2c909993815f33be1796d5f2bc6d3c65a5404fe2.tar.gz
Lead followed by . to show hidden files
-rw-r--r--README.md5
-rw-r--r--src/nnn.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/README.md b/README.md
index 57d8eff..f921dda 100644
--- a/README.md
+++ b/README.md
@@ -283,11 +283,12 @@ The Leader/Lead key provides a powerful multi-functional navigation mechanism. I
| Key | Function |
|:---:| --- |
| <kbd>1-4</kbd> | Go to/create selected context |
-| <kbd>></kbd>, <kbd>.</kbd> | Go to next active context |
-| <kbd><</kbd>, <kbd>,</kbd> | Go to previous active context |
+| <kbd>]</kbd> | Go to next active context |
+| <kbd>[</kbd> | Go to previous active context |
| key | Go to bookmarked location |
| <kbd>'</kbd> | Go to first file in directory |
| <kbd>~</kbd> <kbd>`</kbd> <kbd>@</kbd> <kbd>-</kbd> | Go to HOME, `/`, start, last visited dir |
+| <kbd>.</kbd> | Toggle show hidden files |
| <kbd>q</kbd> | Quit context |
When the filter is on, <kbd>/</kbd> works as an additional Leader key.
diff --git a/src/nnn.c b/src/nnn.c
index 6db57c5..956f586 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3728,7 +3728,7 @@ nochange:
case '@':
presel = fd;
goto nochange;
- case '\'':
+ case '\'': /* jump to first file in the directory */
for (r = 0; r < ndents; ++r) {
if (!(dents[r].flags & DIR_OR_LINK_TO_DIR)) {
move_cursor((r) % ndents, 0);
@@ -3738,12 +3738,17 @@ nochange:
if (r != ndents)
continue;;
goto nochange;
- case '>': // fallthrough
- case '.': // fallthrough
- case '<': // fallthrough
- case ',':
+ case '.':
+ cfg.showhidden ^= 1;
+ setdirwatch();
+ if (ndents)
+ copycurname();
+ goto begin;
+ case ']': // fallthrough
+ case '[': // fallthrough
+ /* visit next and previous contexts */
r = cfg.curctx;
- if (fd == '>' || fd == '.')
+ if (fd == ']')
do
r = (r + 1) & ~CTX_MAX;
while (!g_ctx[r].c_cfg.ctxactive);