소스 검색

Change `less` to display binary file contents

This is the default behavior in many distros, that we had forgone in
favour of syntax highlighting. We found that we seldom use less for
reading code. Currently there is no elegant way to have both.
cinaeco 6 년 전
부모
커밋
09a62bd9d7
1개의 변경된 파일3개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 8
      shell/common/less.sh

+ 3 - 8
shell/common/less.sh

@@ -4,13 +4,8 @@
 # r = display raw control characters (Ctrl-A is ^A)
 # R = display raw ANSI colour escape sequences `^[[...m`
 # M = verbose `less` prompt
-# X = disable termcap init/deinit strings - sometimes these clear the screen.
+# X = disable termcap init/deinit strings - sometimes these clear the screen
 export LESS='-iRMX'
 
-# Try to perform syntax highlighting.
-# `pygments` has slightly friendlier defaults than `source-highlight`.
-if [[ -n $(command -v pygmentize) ]]; then
-  export LESSOPEN="| pygmentize -g %s"
-elif [[ -n $(command -v src-hilite-lesspipe.sh) ]]; then
-  export LESSOPEN="| src-hilite-lesspipe.sh %s"
-fi
+# Use `lesspipe` to display binary file contents.
+[[ -n $(command -v lesspipe) ]] && eval "$(lesspipe)"