make bat(1) use terminal colors
This commit is contained in:
parent
4a66427179
commit
5bbbd60cfc
4
en
4
en
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Copyright (c) 2023 Emma Tebibyte
|
||||
# Copyright (c) 2023 Emma Tebibyte <emma@tebibyte.media>
|
||||
# SPDX-License-Identifier: FSFAP
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
@ -45,6 +45,8 @@ while test -n "$1"; do
|
||||
# use bat for syntax highlighting if it’s available, but remove the frills
|
||||
if command -v bat >/dev/null
|
||||
then
|
||||
# make bat use terminal theme
|
||||
BAT_THEME=ansi; export BAT_THEME
|
||||
# there has to be a temp file for writing the highlighted text to
|
||||
syntax_h() {
|
||||
printf "%s\n" "$1" >"$temp_highlight"
|
||||
|
Loading…
Reference in New Issue
Block a user