From 27d316c006f66e493a02417d383e0d00c2d4dad6 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sat, 8 Apr 2023 12:35:39 -0700 Subject: [PATCH] lfrc.example: Add mkdir, add "show execution result" (#1188) Show how to map `a` to mkdir. `` ` `` maps to "show execution result". Norton Commander & its successors map it to ``, but I think that's better for something opening-relatred. Whenever a `$` command gives an unexpected error, I want to see what happened. There are many ways to do so, but the one I added here seems the simplest and it took me a while to think of it. We could also have an option to have `$` commands pause like `!` commands when there's an error. --- etc/lfrc.example | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/lfrc.example b/etc/lfrc.example index 18bf621c..59f688de 100644 --- a/etc/lfrc.example +++ b/etc/lfrc.example @@ -26,6 +26,9 @@ set cursorpreviewfmt "\033[7;2m" # use enter for shell commands map shell +# show the result of execution of previous commands +map ` !true + # execute current file (must be executable) map x $$f map X !$f @@ -45,6 +48,9 @@ cmd open &{{ esac }} +# mkdir command. See wiki if you want it to select created dir +map a :push %mkdir + # define a custom 'rename' command without prompt for overwrite # cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 # map r push :rename