Last active
June 7, 2017 22:04
-
-
Save cldotdev/5662629 to your computer and use it in GitHub Desktop.
source-highlight configuration
This file contains hidden or 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
| vardef FUNCTION = '[[:blank:]]([[:alpha:]]|_)[[:word:]]*(?=[[:blank:]]*\()' | |
| function = $FUNCTION | |
| keyword = "and|assert|break|class|continue|def|del|elif|else|except|exec", | |
| "finally|for|global|if|in|is|lambda|not|or|pass", | |
| "print|raise|return|try|while|self" |
This file contains hidden or 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 | |
| # /usr/share/source-highlight/src-hilite-lesspipe.sh | |
| for source in "$@"; do | |
| case $source in | |
| *ChangeLog|*changelog) | |
| source-highlight --failsafe -f esc --lang-def=changelog.lang --style-css=${HOME}/.source-highlight/style.css -i "$source" ;; | |
| *Makefile|*makefile) | |
| source-highlight --failsafe -f esc --lang-def=makefile.lang --style-css=${HOME}/.source-highlight/style.css -i "$source" ;; | |
| *bashrc) | |
| source-highlight --failsafe -f esc --lang-def=sh.lang --style-css=${HOME}/.source-highlight/style.css -i "$source" ;; | |
| *.jinja2) | |
| source-highlight --failsafe -f esc --lang-def=html.lang --style-css=${HOME}/.source-highlight/style.css -i "$source" ;; | |
| *) | |
| source-highlight --failsafe --infer-lang -f esc --style-css=${HOME}/.source-highlight/style.css -i "$source" ;; | |
| esac | |
| done |
This file contains hidden or 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
| /* file path: ~/.source-highlight/style.css */ | |
| /* black white red darkred brown yellow cyan blue pink */ | |
| /* purple orange brightorange green brightgreen darkgreen */ | |
| /* teal gray darkblue */ | |
| body { | |
| background-color: black; | |
| } | |
| /* the color for context lines (when specified with line ranges) */ | |
| .context { | |
| color: gray; | |
| } | |
| .keyword { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| .type { | |
| color: darkgreen; | |
| font-weight: bold; | |
| } | |
| .usertype, .classname { | |
| color: yellow; | |
| font-weight: bold; | |
| } | |
| .string { | |
| color: purple; | |
| font-weight: bold; | |
| } | |
| .regexp { | |
| color: yellow; | |
| } | |
| .specialchar { | |
| color: pink; | |
| } | |
| .comment { | |
| color: cyan; | |
| } | |
| .number { | |
| color: yellow; | |
| } | |
| .preproc { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| .symbol { | |
| color: green; | |
| font-weight: bold; | |
| } | |
| .function { | |
| color: yellow; | |
| font-weight: bold; | |
| } | |
| .cbracket { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| .todo { | |
| color: magenta; | |
| } | |
| /* line numbers */ | |
| .linenum { | |
| color: white; font-family: monospace; | |
| } | |
| /* Internet related */ | |
| .url { | |
| color: blue; | |
| text-decoration: underline; | |
| } | |
| /* other elements for ChangeLog and Log files */ | |
| .date { | |
| color: blue; | |
| } | |
| .time, .file { | |
| color: darkblue; | |
| } | |
| .ip, .name { | |
| color: darkgreen; | |
| } | |
| /* for Prolog, Perl */ | |
| .variable { | |
| color: darkgreen; | |
| } | |
| .italics { | |
| color: darkgreen; | |
| font-style: italic; | |
| } | |
| .bold { | |
| color: darkgreen; | |
| font-weight: bold; | |
| } | |
| /* for LaTeX */ | |
| .underline { | |
| color: darkgreen; | |
| text-decoration: underline; | |
| } | |
| .fixed { | |
| color: yellow; | |
| font-family: monospace; | |
| } | |
| .argument, .optionalargument { | |
| color: yellow; | |
| } | |
| .math { | |
| color: purple; | |
| font-weight: bold; | |
| } | |
| .bibtex { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| /* for diffs */ | |
| .oldfile { | |
| color: purple; | |
| font-weight: bold; | |
| } | |
| .newfile { | |
| color: green; | |
| font-weight: bold; | |
| } | |
| .difflines { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| /* for css */ | |
| .selector { | |
| color: blue; | |
| font-weight: bold; | |
| } | |
| .property { | |
| color: yellow; | |
| } | |
| .value { | |
| color: whilte; | |
| } | |
| /* for Oz */ | |
| .atom { | |
| color: orange; | |
| } | |
| .meta { | |
| font-style: italic; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment