| trash-cli | optional | trash files (default action: rm) |
| vlock (Linux), bashlock (macOS), lock(1) (BSD),<br>peaclock (Haiku) | optional | terminal locker (fallback: [cmatrix](https://github.com/abishekvashok/cmatrix)) |
| advcpmv (Linux) ([integration](https://github.com/jarun/nnn/wiki/Advanced-use-cases#show-cp-mv-progress)) | optional | copy, move progress |
+| fortune | optional | random quotes in help screen |
| `$VISUAL` (else `$EDITOR`), `$PAGER`, `$SHELL` | optional | fallback vi, less, sh |
#### From a package manager
complete -c nnn -s e -d 'open text files in $VISUAL/$EDITOR/vi'
complete -c nnn -s E -d 'use EDITOR for undetached edits'
complete -c nnn -s f -d 'use readline history file'
+complete -c nnn -s F -d 'show fortune'
complete -c nnn -s g -d 'regex filters'
complete -c nnn -s H -d 'show hidden files'
complete -c nnn -s K -d 'detect key collision'
'(-e)-e[open text files in $VISUAL/$EDITOR/vi]'
'(-E)-E[use EDITOR for undetached edits]'
'(-f)-f[use readline history file]'
+ '(-F)-F[show fortune]'
'(-g)-g[regex filters]'
'(-H)-H[show hidden files]'
'(-K)-K[detect key collision]'
.Op Ar -e
.Op Ar -E
.Op Ar -f
+.Op Ar -F
.Op Ar -g
.Op Ar -H
.Op Ar -K
.Fl f
use readline history file
.Pp
+.Fl F
+ show fortune in help and settings screen
+.Pp
.Fl g
use regex filters instead of substring match
.Pp
Key:Command | Description
----------------------------------- + -------------------------------------------------
k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
- l:_git log | Show git log
+ g:-_git diff* | Show git diff
+ l:-_git log* | Show git log
n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
p:-_less -iR $nnn* | Page through hovered file in less
s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
| Key:Command | Description |
|---|---|
| `k:-_fuser -kiv $nnn*` | Interactively kill process(es) using hovered file |
-| `l:_git log` | Show git log |
+| `g:-_git diff*` | Show git diff |
+| `l:-_git log*` | Show git log |
| `n:-_vi /home/user/Dropbox/dir/note*` | Take quick notes in a synced file/dir of notes |
| `p:-_less -iR $nnn*` | Page through hovered file in less |
| `s:-_\|smplayer -minigui $nnn` | Play hovered media file, even unfinished download |
#define STATE_MSG 0x20
#define STATE_TRASH 0x40
#define STATE_FORCEQUIT 0x80
+#define STATE_FORTUNE 0x100
-static uchar g_states;
+static uint g_states;
/* Options to identify file mime */
#if defined(__APPLE__)
return;
}
+ if ((g_states & STATE_FORTUNE) && getutil("fortune"))
+ pipetof("fortune -s", fp);
+
start = end = helpstr;
while (*end) {
if (*end == '\n') {
#ifndef NORL
" -f use readline history file\n"
#endif
+ " -F show fortune\n"
" -g regex filters [default: string]\n"
" -H show hidden files\n"
" -K detect key collision\n"
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "Ab:cdeEfgHKnop:QrRs:St:T:Vxh"))) != -1) {
+ : getopt(argc, argv, "Ab:cdeEfFgHKnop:QrRs:St:T:Vxh"))) != -1) {
switch (opt) {
case 'A':
cfg.autoselect = 0;
rlhist = TRUE;
#endif
break;
+ case 'F':
+ g_states |= STATE_FORTUNE;
+ break;
case 'g':
cfg.regex = 1;
filterfn = &visible_re;