Last active
December 24, 2015 23:09
-
-
Save ralavay/6878441 to your computer and use it in GitHub Desktop.
Enable syntax highlight via LESS comand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Enable syntax highlight mode in LESS command by using source-highlight | |
# http://www.gnu.org/software/src-highlite/ | |
sudo apt-get install source-highlight -y | |
cat >> ~/.bashrc <<EOF | |
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" | |
export LESS=" -R" | |
EOF | |
source ~/.bashrc | |
echo " | |
######################################## | |
open a .sh file with 'less' command | |
if not -> run 'source .~/bashrc' again | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment