From 1a29bcb1bee2efe013c96f9da25450a7bc9de177 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 14 Dec 2021 14:45:30 +0100 Subject: [PATCH] bin/b: improve bat integration --- .local/bin/scripts/b | 4 ++-- .local/bin/scripts/help | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index 9dc7578..416d60a 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -124,8 +124,8 @@ if test "$bat" -o "$batl"; then test "$(bat --version | cut -d. -f2)" -gt 16 && rule=,rule if test $# -gt ${#bat[@]} -a $# -gt ${#batl[@]} && test -z "$args" then $elevate head "${batl[@]}" "${bat[@]}" | cut -c-$(echo "$(tput cols)*1.9" | bc | cut -d. -f1) - else test "$bat" && $elevate bat --style header$rule --pager 'less -RF' $args "${bat[@]}" - test "$batl" && $elevate bat --style ${rule#,} --pager 'less -RF' $args "${batl[@]}" + else test "$bat" && $elevate bat --style numbers,header$rule --pager 'less -RF' $args "${bat[@]}" + test "$batl" && $elevate bat --style plain$rule --pager 'less -RF' $args "${batl[@]}" fi fileinfo "${bat[@]}" fi diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index 693c0f4..21e8384 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -9,7 +9,7 @@ case $1 in info --vi-keys "$(test "$last" != zsh && echo "--index-search=$last")" zsh || LESS="$LESS +/^ *$last *\\[" man zshall;; (vlc) unbuffer vlc --full-help "${@:2}" | $paginate;; - (gh|chordpro) "$@" --help | $paginate;; + (gh|chordpro|bat) unbuffer "$@" --help | $paginate;; (caddy|stretchly|go) "$1" help "${@:2}" | $paginate;; (*) man "$@" || { info "$1" -w | grep -v "manpages" && pinfo "$@"; } ||