Skip to content

Instantly share code, notes, and snippets.

@magickatt
Created December 10, 2024 15:23
Show Gist options
  • Save magickatt/7b696f2d68a52667833a9c5656dec73b to your computer and use it in GitHub Desktop.
Save magickatt/7b696f2d68a52667833a9c5656dec73b to your computer and use it in GitHub Desktop.
Configure source-highlight syntax highlighting for less on macOS
#!/bin/bash
brew install source-highlight
# Tell less where source-highlight is installed
# https://www.gnu.org/software/src-highlite/source-highlight.html#Using-source_002dhighlight-with-less
export LESSOPEN="| $(brew list source-highlight | grep src-hilite-lesspipe.sh) %s"
export LESS=' -R '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment