Files
dotfiles/zsh/less.zsh
Jim Myhrberg 17dcac4d75 Add support for source highlighting in less on Linux
On Ubuntu at least, the relevant script is not added to the PATH, so we
manually have to check for it's complete installation path.
2020-05-03 16:05:06 +01:00

15 lines
375 B
Bash

#
# less setup
#
alias le="less"
# Enable syntax highlighting via source-highlight
if (( $+commands[src-hilite-lesspipe.sh] )); then
export LESSOPEN="| src-hilite-lesspipe.sh %s"
export LESS=" -R "
elif [ -f "/usr/share/source-highlight/src-hilite-lesspipe.sh" ]; then
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=" -R "
fi