aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-12 20:21:48 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-12 20:36:23 +0530
commit33365dea52c2491837a9ece847743bf081c44bf0 (patch)
tree4c560ca3f567f88a4a4568e7519fea4a9cb3b2e7 /src
parent3e4797f7289e16c61cf5af9abdec456e0049c67d (diff)
downloadnnn-33365dea52c2491837a9ece847743bf081c44bf0.tar.gz
Shortcut to visit root
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c7
-rw-r--r--src/nnn.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 67ebdf1..6289a08 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2360,7 +2360,7 @@ static bool show_help(const char *path)
"1NAVIGATION\n"
"a↑ k Up PgUp ^U Scroll up\n"
"a↓ j Down PgDn ^D Scroll down\n"
- "a← h Parent dir ~ Go HOME\n"
+ "a← h Parent dir ~ ` HOME, /\n"
"8↵ → l Open file/dir @ Start dir\n"
"4Home g ^A First entry - Last visited dir\n"
"5End G ^E Last entry . Toggle show hidden\n"
@@ -3077,6 +3077,7 @@ nochange:
case SEL_CDHOME: // fallthrough
case SEL_CDBEGIN: // fallthrough
case SEL_CDLAST: // fallthrough
+ case SEL_CDROOT: // fallthrough
case SEL_VISIT:
switch (sel) {
case SEL_CDHOME:
@@ -3088,6 +3089,9 @@ nochange:
case SEL_CDLAST:
dir = lastdir;
break;
+ case SEL_CDROOT:
+ dir = "/";
+ break;
default: /* case SEL_VISIT */
dir = mark;
break;
@@ -3131,6 +3135,7 @@ nochange:
switch (fd) {
case 'q': // fallthrough
case '~': // fallthrough
+ case '`': // fallthrough
case '-': // fallthrough
case '@':
presel = fd;
diff --git a/src/nnn.h b/src/nnn.h
index 2104ede..839ec0c 100644
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -48,6 +48,7 @@ enum action {
SEL_CDHOME,
SEL_CDBEGIN,
SEL_CDLAST,
+ SEL_CDROOT,
SEL_VISIT,
SEL_LEADER,
SEL_CYCLE,
@@ -141,6 +142,8 @@ static struct key bindings[] = {
{ '@', SEL_CDBEGIN },
/* Last visited dir */
{ '-', SEL_CDLAST },
+ /* Go to / */
+ { '`', SEL_CDROOT },
/* Visit marked directory */
{ CONTROL('B'), SEL_VISIT },
/* Leader key */