From fe38baa4f95404acf84a6e31db4346cec146a83c Mon Sep 17 00:00:00 2001 From: Adam <56338480+adastx@users.noreply.github.com> Date: Tue, 19 Apr 2022 23:47:34 +0200 Subject: lf: open text in vim, xdg-open everything else --- .config/lf/lfrc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to '.config/lf') diff --git a/.config/lf/lfrc b/.config/lf/lfrc index a99715a..0eaa9ea 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,9 +1,17 @@ -set hidden true -set ignorecase true +set shell sh +set shellopts '-eu' +set ifs "\n" +set scrolloff 10 set previewer stpv set cleaner stpvimgclr &stpvimg --listen $id cmd on-quit $stpvimg --end $id -map . set hidden! +cmd open ${{ + test -L $f && f=$(readlink -f $f) + 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 +}} -- cgit v1.2.3-70-g09d2