less.sh 598 B

123456789101112131415
  1. # Default Flags for `less`
  2. # e = quit at end of file
  3. # i = searches ignore case, unless there are upper case characters
  4. # r = display raw control characters (Ctrl-A is ^A)
  5. # M = verbose `less` prompt
  6. # X = disable termcap init/deinit strings - sometimes these clear the screen.
  7. export LESS='-iRMX'
  8. # Try to perform syntax highlighting.
  9. # `pygments` has slightly friendlier defaults than `source-highlight`.
  10. if [[ -n $(command -v pygmentize) ]]; then
  11. export LESSOPEN="| pygmentize -g %s"
  12. elif [[ -n $(command -v src-hilite-lesspipe.sh) ]]; then
  13. export LESSOPEN="| src-hilite-lesspipe.sh %s"
  14. fi