Setting up lf

This commit is contained in:
2021-05-23 20:32:50 +01:00
parent 8b109fc010
commit bc8d62e90b
9 changed files with 50 additions and 10 deletions

View File

@@ -76,8 +76,8 @@ map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}
map gh
map g top
map D delete
map E extract
map C copyto
map zx extract
map cp copyto
map M moveto
map <c-n> push :mkdir<space>
map <c-r> reload
@@ -89,7 +89,7 @@ map o &mimeopen $f
map O $mimeopen --ask $f
map A rename # at the very end
map c push A<c-u> # new rename
#map c push A<c-u> # new rename
map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extension
map a push A<a-b> # after extension

8
.config/lf/scope Normal file → Executable file
View File

@@ -32,9 +32,9 @@ HIGHLIGHT_STYLE='pablo'
handle_mime() {
local mimetype="${1}"
case "${mimetype}" in
text/html) w3m -dump "${FILE_PATH}" ;;
text/troff) man ./ "${FILE_PATH}" | col -b ;;
text/* | */xml)
text/html) w3m -dump "${FILE_PATH}" ;;
text/troff) man ./ "${FILE_PATH}" | col -b ;;
text/* | */xml)
if [ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]; then
exit 2
fi
@@ -45,7 +45,7 @@ handle_mime() {
fi
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" ;;
application/zip) atool --list -- "${FILE_PATH}" ;;
application/zip) atool --list -- "${FILE_PATH}" ;;
image/*) chafa --fill=block --symbols=block -c 256 -s 80x"${HEIGHT}" "${FILE_PATH}" || exit 1;;
video/* | audio/*|application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;;
*/pdf) pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - ;;