Created
December 13, 2011 13:08
-
-
Save zamaterian/1472076 to your computer and use it in GitHub Desktop.
Clojure highlightning for cli less via source-hightlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to .bashrc or .profile | |
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" | |
export LESS=' -R ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clojure syntax highlighting for GNU source-highlight | |
# # rocks with SHJS | |
# add file in /usr/share/source-highlight/ | |
comment start ";" | |
include "number.lang" | |
vardef SPECIALCHAR = '\\.' | |
environment string delim "\"" "\"" begin | |
specialchar = $SPECIALCHAR | |
end | |
type = "int|byte|boolean|char|long|float|double|short|void" | |
vardef FUNCTION = '\(([[:alpha:]]|_)[[:word:]]*(?=[[:blank:]]*)' | |
function = $FUNCTION | |
include "symbols.lang" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# in /usr/share/source-highlight/src-hilite-lesspipe.sh | |
for source in $1; do | |
case $source in | |
*clojure|*clj) | |
source-highlight --failsafe -f esc --lang-def=clojure.lang --style-file=esc.style -i $source ;; | |
*ChangeLog|*changelog) | |
source-highlight --failsafe -f esc --lang-def=changelog.lang --style-file=esc.style -i $source ;; | |
*Makefile|*makefile) | |
source-highlight --failsafe -f esc --lang-def=makefile.lang --style-file=esc.style -i $source ;; | |
*) source-highlight --failsafe --infer-lang -f esc --style-file=esc.style -i $source ;; | |
esac | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gists support files. No need to have one big BLOB of text for 3 files.