Browse Source

Use ^B to go to next context

master
Arun Prakash Jana 6 years ago
parent
commit
06ff738b4c
No known key found for this signature in database GPG Key ID: A75979F35C080412
4 changed files with 16 additions and 4 deletions
  1. +1
    -0
      README.md
  2. +2
    -0
      nnn.1
  3. +10
    -4
      src/nnn.c
  4. +3
    -0
      src/nnn.h

+ 1
- 0
README.md View File

@@ -222,6 +222,7 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
→, ↵, l, ^M Open file/enter dir . Toggle show hidden →, ↵, l, ^M Open file/enter dir . Toggle show hidden
/ Filter Ins, ^I Toggle nav-as-you-type / Filter Ins, ^I Toggle nav-as-you-type
b Pin current dir ^W Go to pinned dir b Pin current dir ^W Go to pinned dir
^B Next active context
`, ^/ Leader key LeaderN Switch to context N `, ^/ Leader key LeaderN Switch to context N
Esc Exit prompt ^L Redraw, clear prompt Esc Exit prompt ^L Redraw, clear prompt
^G Quit and cd q Quit context ^G Quit and cd q Quit context


+ 2
- 0
nnn.1 View File

@@ -64,6 +64,8 @@ Toggle navigate-as-you-type mode
Pin current directory Pin current directory
.It Ic ^W .It Ic ^W
Visit pinned directory Visit pinned directory
.It Ic ^B
Next active context
.It Ic `, ^/ .It Ic `, ^/
Leader key Leader key
.It Ic LeaderN .It Ic LeaderN


+ 10
- 4
src/nnn.c View File

@@ -1015,9 +1015,10 @@ static int nextsel(char **run, char **env, int *presel)


c = *presel; c = *presel;


if (c == 0) if (c == 0) {
c = getch(); c = getch();
else { DPRINTF_D(c);
} else {
/* Unwatch dir if we are still in a filtered view */ /* Unwatch dir if we are still in a filtered view */
#ifdef LINUX_INOTIFY #ifdef LINUX_INOTIFY
if (*presel == FILTER && inotify_wd >= 0) { if (*presel == FILTER && inotify_wd >= 0) {
@@ -1978,7 +1979,8 @@ static int show_help(char *path)
"4→, ↵, l, ^M Open file/enter dir . Toggle show hidden\n" "4→, ↵, l, ^M Open file/enter dir . Toggle show hidden\n"
"e/ Filter Ins, ^I Toggle nav-as-you-type\n" "e/ Filter Ins, ^I Toggle nav-as-you-type\n"
"eb Pin current dir ^W Go to pinned dir\n" "eb Pin current dir ^W Go to pinned dir\n"
"a`, ^/ Leader key LeaderN Switch to context N\n" "d^B Next active context\n"
"a`, ^/ Leader key LeaderN Go to context N\n"
"cEsc Exit prompt ^L Redraw, clear prompt\n" "cEsc Exit prompt ^L Redraw, clear prompt\n"
"d^G Quit and cd q Quit context\n" "d^G Quit and cd q Quit context\n"
"aQ, ^Q Quit ? Help, config\n" "aQ, ^Q Quit ? Help, config\n"
@@ -2729,7 +2731,11 @@ nochange:
setdirwatch(); setdirwatch();
goto begin; goto begin;
case SEL_LEADER: case SEL_LEADER:
fd = get_input(NULL); fd = get_input(NULL); // fallthrough
case SEL_CYCLE:
if (sel == SEL_CYCLE)
fd = '>';

switch (fd) { switch (fd) {
case 'q': // fallthrough case 'q': // fallthrough
case '~': // fallthrough case '~': // fallthrough


+ 3
- 0
src/nnn.h View File

@@ -49,6 +49,7 @@ enum action {
SEL_CDBEGIN, SEL_CDBEGIN,
SEL_CDLAST, SEL_CDLAST,
SEL_LEADER, SEL_LEADER,
SEL_CYCLE,
SEL_PIN, SEL_PIN,
SEL_VISIT, SEL_VISIT,
SEL_FLTR, SEL_FLTR,
@@ -153,6 +154,8 @@ static struct key bindings[] = {
/* Leader key */ /* Leader key */
{ CONTROL('_'), SEL_LEADER, "", "" }, { CONTROL('_'), SEL_LEADER, "", "" },
{ '`', SEL_LEADER, "", "" }, { '`', SEL_LEADER, "", "" },
/* Cycle contexts in forward direction */
{ CONTROL('B'), SEL_CYCLE, "", "" },
/* Mark a path to visit later */ /* Mark a path to visit later */
{ 'b', SEL_PIN, "", "" }, { 'b', SEL_PIN, "", "" },
/* Visit marked directory */ /* Visit marked directory */


||||||
x
 
000:0
Loading…
Cancel
Save