linux:less-syntax-highlight
This is an old revision of the document!
Less syntax highlighting
Add the following to ~/.bashrc then reload config or reopen terminal.
### Terminal Syntax Highlighting # Setup: "apt-get install highlight" # Pipe Highlight to less export LESSOPEN="| $(which highlight) %s --out-format xterm256 --line-numbers --quiet --force --style freya" 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 freya" # 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"
linux/less-syntax-highlight.1642693000.txt.gz · Last modified: 2023/05/29 11:53 (external edit)