--
You received this message because you are subscribed to the Google Groups "lf-fm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lf-fm+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lf-fm/40461063-257d-4115-a607-0a869474d33a%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "LF file manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lf-fm+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lf-fm/2b4f8bb2-9d11-48cd-a354-105ccc68d30an%40googlegroups.com.
More info:lf does work mostly as I would like with the lfrc I sent. 'open' does highlight a file and pipe to less. But I have to hit Ctrl-f twice to get open to work, then no matter what I type after 'returning' from highlight, it does the same thing again.
--Facts are stubborn things.
John Adams
Dave,I meant the command type `$` instead of `!`. I also think your open command is more appropriate as a pager command. You may want to get more familiar with the configuration before you make any changes. Feel free to have a look at the documentation and the wiki for more examples.I can't reproduce the twice hit issue on my machine. A single <c-f> opens the file on my machine.GokcehanOn Sun, May 2, 2021 at 9:55 PM Dave Mazzoni <dav...@gmail.com> wrote:I'm not sure what you were saying, did you mean it literally (open command would be $) or to use your example code:# define a custom 'open' command
# This command is called when current file is not a directory. You may want to
# use either file extensions and/or mime types here. Below uses an editor for
# text files and a file opener for the rest.
cmd open ${{
case $(file --mime-type $f -b) in
text/*) $EDITOR $fx;;
*) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;;
esac
}}If I make the changes above (the #define a custom 'open' command...) and start up with vi exported as export EDITOR=/usr/bin/vithere is always two command presses needed (Ctrl-f Ctrl-f) which does start vi on the fileBut after exiting vi -- no matter what I type it goes BACK into the previous file used by vi aboveputs me right back into a vi session (on the same file)If I exit there, I can continue.
One other thing that is unrelated to the problem I had previously was a small script you sent many years ago that used 'lf' to change directory. So I added this to the end of my .bashrc:lf () {
tmp="$(mktemp)"
command lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
[ "$dir" != "$(pwd)" ] && cd "$dir"
fi
rm -f "$tmp"
}which 'exits' lf in the directory that it is displaying.I thought this might be of use to others.