Skip to content

Instantly share code, notes, and snippets.

@caryfuk
Last active April 4, 2018 08:24
Show Gist options
  • Save caryfuk/85e53ff0bf1178a5baf0 to your computer and use it in GitHub Desktop.
Save caryfuk/85e53ff0bf1178a5baf0 to your computer and use it in GitHub Desktop.
### Terminal Syntax Highlighting
# Setup: "brew install highlight"
# Pipe Highlight to less
export LESSOPEN="| $(which highlight) %s --out-format xterm256 --line-numbers --quiet --force --style solarized-light"
export LESS=" -R"
alias less='less -m -N -g -i -J --line-numbers --underline-special'
alias more='less'
# Use "highlight" in place of "cat"
alias cat="highlight $1 --out-format xterm256 --line-numbers --quiet --force --style solarized-light"
# Setup JSON Syntax Highlighting
# Copy js.lang to json.lang with the following command
# cp "$(dirname $(brew list highlight | head -n 1))/share/highlight/langDefs/js.lang" "$(dirname $(brew list highlight | head -n 1))/share/highlight/langDefs/json.lang"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment