Skip to content

Shell tweaks:


setup colored less output

  • install following packages

  • on ubuntu:

    sudo apt install libsource-highlight-common source-highlight
    
  • on fedora:

    sudo dnf install source-highlight
    
  • getting the scripts path:

  • ubuntu:

    export HIGHLIGHTER=`dpkg -L libsource-highlight-common | grep lesspipe`
    
  • fedora:

    export HIGHLIGHTER=`rpm -ql source-highlight | grep lesspipe`
    
  • adding env vars to your favorite shell:

# get used shell and it's config file
USED_SHELL=`echo $SHELL | rev | cut -d'/' -f1 | rev`
SHELL_CONF=".${USED_SHELL}rc"
# append exports to config file
echo export LESSOPEN='"| '$HIGHLIGHTER '%s"' >> $HOME/$SHELL_CONF
echo export LESS='" -R "' >> $HOME/$SHELL_CONF