aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-18 18:50:08 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-18 18:57:04 +0530
commit3004694cd46baa2d5d208ae536d6537851e2cb60 (patch)
tree5638b675a3bb266f80941bfadbf3b729346a0dbd
parent577d8d9bfc5e2c210b3e487c38773954e933d7fa (diff)
downloadnnn-3004694cd46baa2d5d208ae536d6537851e2cb60.tar.gz
Update man page on executing commands directly.
Remove extra static string.
-rw-r--r--nnn.110
-rw-r--r--src/nnn.c7
2 files changed, 13 insertions, 4 deletions
diff --git a/nnn.1 b/nnn.1
index 12414d0..f268fdb 100644
--- a/nnn.1
+++ b/nnn.1
@@ -189,6 +189,16 @@ when dealing with the !, e and p commands respectively. A single combination to
NOTE: To run a plugin directly, press \fI:\fR followed by the plugin key.
.Ed
.Pp
+ To assign keys to arbitrary non-background cli commands (non-shell-interpreted) and invoke like plugins, add \fI_\fR (underscore) before the command.
+.Bd -literal
+ export NNN_PLUG='x:_chmod +x $NNN;g:_git log;s:_smplayer $NNN;o:fzopen'
+
+ NOTES:
+ 1. Use single quotes for $NNN_PLUG so $NNN is not interpreted
+ 2. $NNN should be the last argument (IF you want to pass the hovered file name)
+ 3. (Again) add \fI_\fR before the command
+.Ed
+.Pp
\fBNNN_USE_EDITOR:\fR use VISUAL (else EDITOR, preferably CLI, fallback vi) to handle text files.
.Bd -literal
export NNN_USE_EDITOR=1
diff --git a/src/nnn.c b/src/nnn.c
index a9177f0..6be89fb 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -621,12 +621,11 @@ static void xdelay(void)
static char confirm_force(bool selection)
{
- char str[64] = "forcibly remove current file (unrecoverable)? [y/Y confirms]";
+ char str[64];
int r;
- if (selection)
- snprintf(str, 64, "forcibly remove %d file(s) (unrecoverable)? [y/Y confirms]", nselected);
-
+ snprintf(str, 64, "forcibly remove %s file%s (unrecoverable)? [y/Y confirms]",
+ (selection ? xitoa(nselected) : "current"), (selection ? "(s)" : ""));
r = get_input(str);
if (r == 'y' || r == 'Y')