diff --git a/lesspipe.1 b/lesspipe.1 index f0f3717..45f43be 100644 --- a/lesspipe.1 +++ b/lesspipe.1 @@ -112,7 +112,7 @@ a preferred one can be forced for colorizing by setting the ENV variable .I LESSCOLORIZER='pygmentize -O style=foo' (-P allowed as well) .RE .RS -.I LESSCOLORIZER='bat --style=foo --theme=bar' +.I LESSCOLORIZER='bat --style=foo --theme=bar' (default is theme ansi, style plain) .RE Syntax highlighting is activated, if the environment variable \fBLESS\fP exists and contains the option \fI-R\fP diff --git a/lesspipe.sh b/lesspipe.sh index c3d4a71..62ad331 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -472,7 +472,11 @@ has_colorizer () { [[ -n "$3" ]] && opt=(-l "$3" "$1") ;; nvimpager) opt=(-c "$1") - [[ -n "$3" ]] && opt=(-c "$1" -c "set filetype=$3") ;; + if [[ -n "$3" ]]; then + ft=${3##*/} + ft=${ft##*.} + opt=(-c "$1" --cmd "set filetype=$ft") + fi ;; *) return ;; esac