User Tools

Site Tools


linux:less-syntax-highlight

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:less-syntax-highlight [2022/01/20 15:37] Wulf Rajeklinux:less-syntax-highlight [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 8: Line 8:
 # Setup: "apt-get install highlight" # Setup: "apt-get install highlight"
  
-# Pipe Highlight to less+# Pipe Highlight to less (remove --line-numbers option for better copy&pasting)
 export LESSOPEN="| $(which highlight) %s --out-format xterm256 --line-numbers --quiet --force --style freya" export LESSOPEN="| $(which highlight) %s --out-format xterm256 --line-numbers --quiet --force --style freya"
 export LESS=" -R" export LESS=" -R"
 +# remove -N and --line-numbers for better copy&pasting. other options can be defined like this:
 alias less='less -m -N -g -i -J --line-numbers --underline-special' alias less='less -m -N -g -i -J --line-numbers --underline-special'
 alias more='less' alias more='less'
Line 30: Line 31:
 moria moria
 solarized-light solarized-light
 +
 +
 +To only allow ansi control characters of text files, add to .bashrc
 +<code>
 +export LESS=" -R"
 +</code>
 +
 +
linux/less-syntax-highlight.1642693063.txt.gz · Last modified: 2023/05/29 11:53 (external edit)