complete -c nnn -s d -d 'start in detail mode'
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 g -d 'regex filters'
complete -c nnn -s H -d 'show hidden files'
complete -c nnn -s K -d 'detect key collision'
'(-d)-d[start in detail mode]'
'(-e)-e[open text files in $VISUAL/$EDITOR/vi]'
'(-E)-E[use EDITOR for undetached edits]'
+ '(-f)-f[use readline history file]'
'(-g)-g[regex filters]'
'(-H)-H[show hidden files]'
'(-K)-K[detect key collision]'
" -d detail mode\n"
" -e text in $VISUAL ($EDITOR/vi)\n"
" -E use EDITOR for undetached edits\n"
+#ifndef NORL
+ " -f use readline history file\n"
+#endif
" -g regex filters [default: string]\n"
" -H show hidden files\n"
" -K detect key collision\n"
#endif
const char* const env_opts = xgetenv(env_cfg[NNN_OPTS], NULL);
int env_opts_id = env_opts ? (int)strlen(env_opts) : -1;
+#ifndef NORL
+ bool rlhist = FALSE;
+#endif
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:cdeEgHKnop:QrRs:St:T:Vxh"))) != -1) {
+ : getopt(argc, argv, "aAb:cdeEfgHKnop:QrRs:St:T:Vxh"))) != -1) {
switch (opt) {
case 'a':
cfg.mtime = 0;
case 'E':
cfg.waitedit = 1;
break;
+ case 'f':
+#ifndef NORL
+ rlhist = TRUE;
+#endif
+ break;
case 'g':
cfg.regex = 1;
filterfn = &visible_re;
#else
rl_bind_key('\t', rl_complete);
#endif
- mkpath(cfgdir, ".history", g_buf);
- read_history(g_buf);
+ if (rlhist) {
+ mkpath(cfgdir, ".history", g_buf);
+ read_history(g_buf);
+ }
#endif
#ifndef NOMOUSE
exitcurses();
#ifndef NORL
- mkpath(cfgdir, ".history", g_buf);
- write_history(g_buf);
+ if (rlhist) {
+ mkpath(cfgdir, ".history", g_buf);
+ write_history(g_buf);
+ }
#endif
if (cfg.pickraw) {