]> Sergey Matveev's repositories - nnn.git/commitdiff
Key Lead' to go to first file in dir
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 7 Aug 2019 14:17:17 +0000 (19:47 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 7 Aug 2019 14:17:17 +0000 (19:47 +0530)
README.md
src/nnn.c

index 20cb9a26a8a7f2d931098df1b5f5e00330a773a9..0663d9edc37033abef041746983ef3e094804ae1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -323,6 +323,7 @@ The Leader/Lead key provides a powerful multi-functional navigation mechanism. I
 | <kbd>></kbd>, <kbd>.</kbd> | Go to next active context |
 | <kbd><</kbd>, <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>q</kbd> | Quit context |
 
index f41558b973dd95d94def4efa6ba5456ff432810a..8756b0ded6a1a5359acca5555fec00d0a57ff630 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3669,6 +3669,16 @@ nochange:
                        case '@':
                                presel = fd;
                                goto nochange;
+                       case '\'':
+                               for (r = 0; r < ndents; ++r) {
+                                       if (!(dents[r].flags & DIR_OR_LINK_TO_DIR)) {
+                                               move_cursor((r) % ndents, 0);
+                                               break;
+                                       }
+                               }
+                               if (r != ndents)
+                                       continue;;
+                               goto nochange;
                        case '>': // fallthrough
                        case '.': // fallthrough
                        case '<': // fallthrough