From 7080677cadcebe5265103b1645ac0b6badeadeca Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 Jun 2025 13:05:59 +0200 Subject: [PATCH] Add previewer to lf --- lf/.config/lf/lfrc | 3 +++ lf/.config/lf/pv.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100755 lf/.config/lf/pv.sh diff --git a/lf/.config/lf/lfrc b/lf/.config/lf/lfrc index ec7fb66..a720229 100644 --- a/lf/.config/lf/lfrc +++ b/lf/.config/lf/lfrc @@ -1,2 +1,5 @@ set hidden true set icons true + +set previewer ~/.config/lf/pv.sh +map i $~/.config/lf/pv.sh $f | less -R diff --git a/lf/.config/lf/pv.sh b/lf/.config/lf/pv.sh new file mode 100755 index 0000000..aacb45a --- /dev/null +++ b/lf/.config/lf/pv.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +case "$1" in + *.tar*) tar tf "$1";; + *.zip) unzip -l "$1";; + *.rar) unrar l "$1";; + *.7z) 7z l "$1";; + *.pdf) pdftotext "$1" -;; + *) highlight -O ansi "$1";; + #*) bat -P "$1";; +esac