首先安装source-highlight:
$ sudo apt-get install source-highlight
然后配置.lessfilter文件:
$ cat ~/.lessfilter
#!/bin/bash
case $1 in
*ChangeLog | *changelog )
source-highlight --failsafe -f esc --lang-def=changelog.lang --style-file=esc.style -t 2 -i $1
;;
*Makefile | *makefile )
source-highlight --failsafe -f esc --lang-def=makefile.lang --style-file=esc.style -t 2 -i $1
;;
*)
source-highlight --infer-lang -f esc --style-file=esc.style -t 2 -i $1
;;
esac
并在.bashrc文件中添加一行:
export LESS='-R'
最后执行:
$ . ~/.bashrc
No comments:
Post a Comment