From 2c909993815f33be1796d5f2bc6d3c65a5404fe2 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 25 Aug 2019 06:05:10 +0530 Subject: [PATCH] Lead followed by . to show hidden files --- README.md | 5 +++-- src/nnn.c | 17 +++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 57d8effc..f921ddac 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 | |:---:| --- | | 1-4 | Go to/create selected context | -| >, . | Go to next active context | -| <, , | Go to previous active context | +| ] | Go to next active context | +| [ | Go to previous active context | | key | Go to bookmarked location | | ' | Go to first file in directory | | ~ ` @ - | Go to HOME, `/`, start, last visited dir | +| . | Toggle show hidden files | | q | Quit context | When the filter is on, / works as an additional Leader key. diff --git a/src/nnn.c b/src/nnn.c index 6db57c50..956f586d 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);