From 6fc6551b02aaef0fe8905d1e79bb13ae23cc4c6f Mon Sep 17 00:00:00 2001 From: Felix Nehrke Date: Fri, 5 Sep 2025 14:28:31 +0200 Subject: [PATCH] Use lesspipe ad less-preprocessor On typical linux distros `lesspipe` is already shipped as part of less. Though on macos it isn't, but I found out that it can be isntalled via brew. So, I have no reason to not use and can savely ditch my custom lessfilter. --- .bashrc | 2 +- .local/bin/lessfilter | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100755 .local/bin/lessfilter diff --git a/.bashrc b/.bashrc index 15eec86..67c61b4 100644 --- a/.bashrc +++ b/.bashrc @@ -82,7 +82,7 @@ which zoxide > /dev/null && eval "$(zoxide init bash)" && alias cd=z if [ -f .local/bin/lessfilter ] then export LESS='-R' - export LESSOPEN='|~/.local/bin/lessfilter %s' + export LESSOPEN='|lesspipe %s' fi [ -s "$XDG_CONFIG_HOME/bash/local-config" ] && . "$XDG_CONFIG_HOME/bash/local-config" diff --git a/.local/bin/lessfilter b/.local/bin/lessfilter deleted file mode 100755 index d3b1a49..0000000 --- a/.local/bin/lessfilter +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -case "$1" in - *.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\ - *.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\ - *.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\ - *.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass|*.vim|\ - .vimrc|*.yaml|*.yml|*.json|*.properties|*.html|*.scss|\ - *.css|*.ts) - pygmentize -f 256 "$1";; - - .bashrc|.bash_aliases|.bash_environment|.profile) - pygmentize -f 256 -l sh "$1";; - - *) - if grep -q "#\!/bin/bash" "$1" 2> /dev/null; then - pygmentize -f 256 -l sh "$1" - else - exit 1 - fi -esac - -exit 0