Skip to content

Instantly share code, notes, and snippets.

View mdoering's full-sized avatar

Markus Döring mdoering

View GitHub Profile
@jaygooby
jaygooby / src-hilite-lesspipe.sh
Last active February 21, 2024 08:37
A modified version of gnu source-highlight's src-hilite-lesspipe.sh that also works with piped files and files with no extensions. It uses the file command to guess the language. This means you can use source-highlight in conjunction with commands like "git show"
#! /bin/bash
#
# Based on http://git.savannah.gnu.org/cgit/src-highlite.git/tree/src/src-hilite-lesspipe.sh.in
# by Lorenzo Bettini
#
# Modified by Jay Caines-Gooby to support piped files
# jay@gooby.org
# @jaygooby
#
# Typically called by setting: