diff --git a/.config/lf/preview/preview b/.config/lf/preview/preview index 301e7ebae..d041ecdbe 100755 --- a/.config/lf/preview/preview +++ b/.config/lf/preview/preview @@ -23,7 +23,7 @@ video() { } text() { - for cmd in bat batcat cat; do + for cmd in bat batcat head; do command -v $cmd >/dev/null 2>&1 && break done case $cmd in @@ -35,10 +35,11 @@ text() { --pager=never \ --tabs=4 \ --theme=base16 \ + --line-range=":$h" \ --terminal-width="$((w - 2))" "$@" "$f" ;; - cat) - $cmd "$f" + head) + head -n "$h" "$f" ;; esac }