]> Sergey Matveev's repositories - nnn.git/commitdiff
Bind ^J with toggle auto-jump on open
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 16 Apr 2022 12:06:07 +0000 (17:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 16 Apr 2022 12:34:09 +0000 (18:04 +0530)
README.md
misc/auto-completion/fish/nnn.fish
misc/auto-completion/zsh/_nnn
nnn.1
patches/gitstatus/mainline.diff
patches/gitstatus/namefirst.diff
patches/restorepreview/mainline.diff
src/nnn.c
src/nnn.h

index 627d2692f5af5fd6bc48e15880ee314e08666d0a..92263b63b7bcf232539443c3dbf774fcc1e35b03 100644 (file)
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ Runs on the Pi, [Termux](https://www.youtube.com/embed/AbaauM7gUJw) (Android), L
   - Remote mounts (needs `sshfs`, `rclone`)
   - Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick look-up
   - `cd` on quit (*easy* shell integration)
-  - Auto-proceed on file open and selection
+  - Jump to next file on file open and selection
 - Search
   - Instant filtering with *search-as-you-type*
   - Regex (POSIX/PCRE) and string (default) filters
index 213c5e434093ea0896297d31a3b62fdc49e8d3c6..968759fdec46551a56f5687dae3565171335398d 100644 (file)
@@ -24,7 +24,7 @@ complete -c nnn -s f    -d 'use readline history file'
 complete -c nnn -s g    -d 'regex filters'
 complete -c nnn -s H    -d 'show hidden files'
 complete -c nnn -s i    -d 'show current file info'
-complete -c nnn -s J    -d 'no auto-proceed on select'
+complete -c nnn -s J    -d 'no auto-jump on select'
 complete -c nnn -s K    -d 'detect key collision'
 complete -c nnn -s l -r -d 'lines to move per scroll'
 complete -c nnn -s n    -d 'start in type-to-nav mode'
index fbb451f4f73129aec465c55044d751aedf6c12c8..c2dfb31e76659a1a87dbe6b307320c725fa40cf5 100644 (file)
@@ -22,7 +22,7 @@ args=(
     '(-g)-g[regex filters]'
     '(-H)-H[show hidden files]'
     '(-i)-i[show current file info]'
-    '(-J)-J[no auto-proceed on select]'
+    '(-J)-J[no auto-jump on select]'
     '(-K)-K[detect key collision]'
     '(-l)-l[lines to move per scroll]:val'
     '(-n)-n[start in type-to-nav mode]'
diff --git a/nnn.1 b/nnn.1
index b9deaa6d54e198d55625ce05cf85f6df66877af1..e7d0f0d30458e45c2ff416fdadc83be85ab91d19 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -88,7 +88,7 @@ supports the following options:
         show current file information in info bar (may be slow)
 .Pp
 .Fl J
-        disable auto-proceed on selection
+        disable auto-jump on selection
         (eg. selecting an entry will no longer move cursor to the next entry)
 .Pp
 .Fl K
@@ -235,7 +235,7 @@ in \fBtype-to-nav\fR mode:
   Key  |         Function
 ------ + ------------------------
    '   | Go to first non-dir file
-   +   | Toggle auto-proceed on open
+   +   | Toggle file selection
    ,   | Mark CWD
    -   | Go to last visited dir
    .   | Show hidden files
index ddf331cfb596a30bf80444a8afc565ac68d5f87d..88d199083742865d0d93ff9329086fc8e5846450 100644 (file)
@@ -210,7 +210,7 @@ index 1028906a..c80314de 100644
 +              " -G      always show git status\n"
                " -H      show hidden files\n"
                " -i      show current file info\n"
-               " -J      no auto-proceed on select\n"
+               " -J      no auto-jump on select\n"
 @@ -8266,6 +8382,7 @@ static void cleanup(void)
                free(hostname);
        }
index c11dde2d76a23254eceb11c3a66d6b27f6d00643..7f0befff45d22907080a6aada1026ada47568975 100644 (file)
@@ -213,7 +213,7 @@ index af586056..9ebfb203 100644
 +              " -G      always show git status\n"
                " -H      show hidden files\n"
                " -i      show current file info\n"
-               " -J      no auto-proceed on select\n"
+               " -J      no auto-jump on select\n"
 @@ -8272,6 +8387,7 @@ static void cleanup(void)
                free(hostname);
        }
index 979f96595477c9301d900073e45dacdb07f71a49..015588994d7bd3d317b9a517bf1b10ca1e63d059 100644 (file)
@@ -1,5 +1,5 @@
 # Description: Adds preview pipe to enable closing and re-opening the preview
-#              pane when running an undetached editor. If you are using vim 
+#              pane when running an undetached editor. If you are using vim
 #              you might experience incorrectly resized window. Consider adding
 #              the following to your vimrc:
 #              autocmd VimEnter * :silent exec "!kill -s WINCH $PPID"
@@ -11,7 +11,7 @@ index 4243f2cc..b893f573 100644
 --- a/src/nnn.c
 +++ b/src/nnn.c
 @@ -370,7 +370,8 @@ typedef struct {
-       uint_t stayonsel  : 1;  /* Disable auto-proceed on select */
+       uint_t stayonsel  : 1;  /* Disable auto-jump on select */
        uint_t trash      : 2;  /* Trash method 0: rm -rf, 1: trash-cli, 2: gio trash */
        uint_t uidgid     : 1;  /* Show owner and group info */
 -      uint_t reserved   : 7;  /* Adjust when adding/removing a field */
index a102d9ea4126bd1a296b68f37bf5ac9a0ba02b1b..3a95f1b4598968e218aa28e4440647d7b9383848 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -350,7 +350,7 @@ typedef struct {
 /* Non-persistent program-internal states (alphabeical order) */
 typedef struct {
        uint_t autofifo   : 1;  /* Auto-create NNN_FIFO */
-       uint_t autonext   : 1;  /* Auto-proceed on open */
+       uint_t autonext   : 1;  /* Auto-jump on open */
        uint_t dircolor   : 1;  /* Current status of dir color */
        uint_t dirctx     : 1;  /* Show dirs in context color */
        uint_t duinit     : 1;  /* Initialize disk usage */
@@ -368,7 +368,7 @@ typedef struct {
        uint_t runctx     : 3;  /* The context in which plugin is to be run */
        uint_t runplugin  : 1;  /* Choose plugin mode */
        uint_t selmode    : 1;  /* Set when selecting files */
-       uint_t stayonsel  : 1;  /* Disable auto-proceed on select */
+       uint_t stayonsel  : 1;  /* Disable auto-jump on select */
        uint_t trash      : 2;  /* Trash method 0: rm -rf, 1: trash-cli, 2: gio trash */
        uint_t uidgid     : 1;  /* Show owner and group info */
        uint_t reserved   : 7;  /* Adjust when adding/removing a field */
@@ -3376,7 +3376,7 @@ static int filterentries(char *path, char *lastname)
                        if (cfg.filtermode) {
                                switch (*ch) {
                                case '\'': // fallthrough /* Go to first non-dir file */
-                               case '+': // fallthrough /* Toggle auto-proceed on open */
+                               case '+': // fallthrough /* Toggle file selection */
                                case ',': // fallthrough /* Mark CWD */
                                case '-': // fallthrough /* Visit last visited dir */
                                case '.': // fallthrough /* Show hidden files */
@@ -5023,7 +5023,7 @@ static void show_help(const char *path)
               "9Lt h  Parent%-12c~ ` @ -  ~, /, start, prev\n"
           "5Ret Rt l  Open%-20c'  First file/match\n"
               "9g ^A  Top%-21c.  Toggle hidden\n"
-              "9G ^E  End%-21c+  Toggle auto-proceed on open\n"
+              "9G ^E  End%-20c^J  Toggle auto-jump on open\n"
              "8B (,)  Book(mark)%-11cb ^/  Select bookmark\n"
                "a1-4  Context%-11c(Sh)Tab  Cycle/new context\n"
            "62Esc ^Q  Quit%-20cq  Quit context\n"
@@ -8146,7 +8146,7 @@ static void usage(void)
                " -g      regex filters\n"
                " -H      show hidden files\n"
                " -i      show current file info\n"
-               " -J      no auto-proceed on selection\n"
+               " -J      no auto-jump on selection\n"
                " -K      detect key collision\n"
                " -l val  set scroll lines\n"
                " -n      type-to-nav mode\n"
index 5884131495a8ed080ce9251e741ee70b5fd3da11..5e23cc3d0472d08e10c150f34a83a7538e1ec147 100644 (file)
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -247,8 +247,8 @@ static struct key bindings[] = {
        { 'u',            SEL_UMOUNT },
        /* Show help */
        { '?',            SEL_HELP },
-       /* Quit a context */
-       { '+',            SEL_AUTONEXT },
+       /* Toggle auto-jump on open */
+       { CONTROL('J'),   SEL_AUTONEXT },
        /* Edit in EDITOR */
        { 'e',            SEL_EDIT },
        /* Run a plugin */