Add previewer to lf

This commit is contained in:
Tim
2025-06-13 13:05:59 +02:00
parent 560d72e605
commit 7080677cad
2 changed files with 14 additions and 0 deletions

View File

@ -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

11
lf/.config/lf/pv.sh Executable file
View File

@ -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