]> Sergey Matveev's repositories - nnn.git/commitdiff
Use the term Leader key
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 11 Nov 2018 22:06:37 +0000 (03:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 11 Nov 2018 22:07:17 +0000 (03:37 +0530)
README.md
nnn.1
src/nnn.c
src/nnn.h

index 339a1e0bb9cb1488d7ce44aff24bd4b9a5b0202b..0a1bf95df12ba72ffd3607d388a45a1433f1ff09 100644 (file)
--- a/README.md
+++ b/README.md
@@ -218,7 +218,7 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
     →, ↵, l, ^M  Open file/enter dir   .  Toggle show hidden
               /  Filter          Ins, ^I  Toggle nav-as-you-type
               b  Pin current dir      ^V  Go to pinned dir
-             ^B  Leader key      LeaderN  Switch to context N
+          `, ^/  Leader key      LeaderN  Switch to context N
             Esc  Exit prompt          ^L  Redraw, clear prompt
              ^G  Quit and cd           q  Quit context
           Q, ^Q  Quit                  ?  Help, settings
@@ -245,7 +245,7 @@ Help & settings, file details, media info and archive listing are shown in the P
 
 #### Leader key
 
-The Leader key <kbd>^B</kbd> provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts.
+The Leader key (<kbd>`</kbd> or <kbd>^/</kbd>) provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts.
 
 | Key | Function |
 |:---:| --- |
@@ -266,6 +266,8 @@ Contexts serve the purpose of exploring multiple directories simultaneously. 4 c
 - other used contexts are underlined
 - rest are unused
 
+To switch to a context press the Leader key followed by the context number (1-4).
+
 The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
 
 When a context is quit, the next active context is selected. If the last active context is quit, the program quits.
diff --git a/nnn.1 b/nnn.1
index 4ebb392e31de3eda427c74bc38d02f3f7f38380b..b07a134fc12c5e0205ff6e7b021a00a8fc587d95 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -63,7 +63,7 @@ Toggle navigate-as-you-type mode
 Pin current directory
 .It Ic ^V
 Visit pinned directory
-.It Ic ^B
+.It Ic `, ^/
 Leader key
 .It Ic LeaderN
 Switch to context N
@@ -199,8 +199,8 @@ to change to the last visited directory on quit requires shell integration in a
 few easy steps. Please visit the project page (linked below) for the
 instructions.
 .Sh CONTEXTS
-Contexts (aka \fItabs\fR aka \fIworkspaces\fR) serve the purpose of exploring multiple directories
-simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:
+Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts
+are available. The status of the contexts are shown in the top left corner:
 .Pp
 - the current context is in reverse
 .br
@@ -208,7 +208,7 @@ simultaneously. 4 contexts are available. The status of the contexts are shown i
 .br
 - rest are unused
 .Pp
-The key prompt understands contexts. To switch contexts press \fI^B\fR and enter the context number (1-4).
+To switch to a context press the Leader key followed by the context number (1-4).
 .Pp
 The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
 .Pp
index 03b421cf76132994264a1c34fa3541216531e3f6..bcc54b22a918eaa1901b7e2f9ed6d3c40248e508 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1371,7 +1371,7 @@ static int parsebmstr()
                        ++bms;
 
                        /*
-                        * Use single-char keys to use ^B like vim Leader key.
+                        * Use single-char keys to combine with Leader key.
                         * Fail here to ensure keys are single char.
                         * To support multiple char keys remove the return
                         * and add appropriate check to enable smart-detect.
@@ -1976,7 +1976,7 @@ static int show_help(char *path)
    "4→, ↵, l, ^M  Open file/enter dir   .  Toggle show hidden\n"
              "e/  Filter          Ins, ^I  Toggle nav-as-you-type\n"
              "eb  Pin current dir      ^V  Go to pinned dir\n"
-            "d^B  Leader key      LeaderN  Switch to context N\n"
+         "a`, ^/  Leader key      LeaderN  Switch to context N\n"
            "cEsc  Exit prompt          ^L  Redraw, clear prompt\n"
             "d^G  Quit and cd           q  Quit context\n"
          "aQ, ^Q  Quit                  ?  Help, settings\n"
index b98592d886558f2ac329f770704151ef5fa3347c..9e2ce902643c77aa7c3d1097a9e7a81d5984d0ea 100644 (file)
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -150,7 +150,8 @@ static struct key bindings[] = {
        /* Last visited dir */
        { '-',            SEL_CDLAST,    "",     "" },
        /* Leader key */
-       { CONTROL('B'),   SEL_LEADER,    "",     "" },
+       { CONTROL('_'),   SEL_LEADER,    "",     "" },
+       { '`',            SEL_LEADER,    "",     "" },
        /* Mark a path to visit later */
        { 'b',            SEL_PIN,       "",     "" },
        /* Visit marked directory */