From 1d1e0ad2c64a94fb115d3f9e375715916cd661f7 Mon Sep 17 00:00:00 2001 From: pika <67532734+pik4li@users.noreply.github.com> Date: Mon, 6 Jan 2025 02:19:12 +0100 Subject: [PATCH] addet syntax highlighting? --- .bashrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.bashrc b/.bashrc index 2d98704..996bbe4 100644 --- a/.bashrc +++ b/.bashrc @@ -166,8 +166,17 @@ _sensible.bash_() { # export documents="$HOME/Documents" # export dropbox="$HOME/Dropbox" } +syntax_highlighting() { + export LESS='-R' + export BASH_PREEXEC_HOOKS=() + _syntax_highlighting() { + source-highlight -i $1 -o $1.html + less -R $1.html + } +} _init() { + syntax_highlighting # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"