src/nnn.c | 11 ++++++++--- src/nnn.h | 5 ++++- diff --git a/src/nnn.c b/src/nnn.c index acc65128f7078ea8c71b37e5680cb8fc82624de0..e6305c139fbcd29d12d161128b155673bbaaf898 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -531,7 +531,7 @@ "copy name: ", "\nPress Enter to continue", "open failed", "dir inaccessible", - "empty: use open with", + "empty: edit or open with", "unsupported file", "not set", "entry exists", @@ -3976,11 +3976,12 @@ "1FILES\n" "9o ^O Open with...%-12cn Create new/link\n" "9f ^F File details%-12cd Detail view toggle\n" "b^R Rename/dup%-14cr Batch rename\n" - "cz Archive%-17c* Toggle exe\n" + "cz Archive%-17ce Edit in EDITOR\n" "5Space ^J (Un)select%-11cm ^K Mark range/clear\n" "9p ^P Copy sel here%-11ca Select all\n" "9v ^V Move sel here%-8cw ^W Copy/move sel as\n" - "9x ^X Delete%-18ce Edit sel\n" + "9x ^X Delete%-18cE Edit sel\n" + "c* Toggle exe%-0c\n" "1MISC\n" "9; ^S Select plugin%-11c= Launch app\n" "9! ^] Shell%-19c] Cmd prompt\n" @@ -5461,6 +5462,7 @@ break; case SEL_REDRAW: // fallthrough case SEL_RENAMEMUL: // fallthrough case SEL_HELP: // fallthrough + case SEL_EDIT: // fallthrough case SEL_LOCK: { bool refresh = FALSE; @@ -5485,6 +5487,9 @@ case SEL_HELP: show_help(path); if (cfg.filtermode) presel = FILTER; + continue; + case SEL_EDIT: + spawn(editor, dents[cur].name, NULL, path, F_CLI); continue; default: /* SEL_LOCK */ lock_terminal(); diff --git a/src/nnn.h b/src/nnn.h index efa6ae686d0d4c864557919ade25b307c269b9c0..168b43badf1980fa22ae360b83e46ef59ea5897e 100644 --- a/src/nnn.h +++ b/src/nnn.h @@ -84,6 +84,7 @@ SEL_RENAMEMUL, SEL_REMOTE, SEL_UMOUNT, SEL_HELP, + SEL_EDIT, SEL_PLUGIN, SEL_SHELL, SEL_LAUNCH, @@ -190,7 +191,7 @@ { CONTROL('K'), SEL_SELMUL }, /* Select all files in current dir */ { 'a', SEL_SELALL }, /* List, edit selection */ - { 'e', SEL_SELEDIT }, + { 'E', SEL_SELEDIT }, /* Copy from selection buffer */ { 'p', SEL_CP }, { CONTROL('P'), SEL_CP }, @@ -218,6 +219,8 @@ /* Disconnect a SSHFS mount point */ { 'u', SEL_UMOUNT }, /* Show help */ { '?', SEL_HELP }, + /* Edit in EDITOR */ + { 'e', SEL_EDIT }, /* Run a plugin */ { ';', SEL_PLUGIN }, { CONTROL('S'), SEL_PLUGIN },