From 17dcac4d75d80e0c68184b099cc92741e0f09dcb Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 3 May 2020 16:02:18 +0100 Subject: [PATCH] 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. --- zsh/less.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/less.zsh b/zsh/less.zsh index 6e66b41..e6960cb 100644 --- a/zsh/less.zsh +++ b/zsh/less.zsh @@ -8,4 +8,7 @@ alias le="less" 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