Skip to content

Commit

Permalink
lfrc.example: Add mkdir, add "show execution result"
Browse files Browse the repository at this point in the history
Show how to map `a` to mkdir. `` ` `` maps to "show execution
result". Norton Commander & its successors map it to `<c-o>`,
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.
  • Loading branch information
ilyagr committed Apr 3, 2023
1 parent 27ab67a commit d25accb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions etc/lfrc.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ set cursorpreviewfmt "\033[7;2m"
# use enter for shell commands
map <enter> shell

# show the result of execution of previous commands
map ` !true

# execute current file (must be executable)
map x $$f
map X !$f
Expand All @@ -45,6 +48,9 @@ cmd open &{{
esac
}}

# mkdir command. See wiki if you want it to select created dir
map a :push %mkdir<space>

# define a custom 'rename' command without prompt for overwrite
# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
# map r push :rename<space>
Expand Down

0 comments on commit d25accb

Please sign in to comment.