less.sh 655 B

12345678910111213141516
  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. # R = display raw ANSI colour escape sequences `^[[...m`
  6. # M = verbose `less` prompt
  7. # X = disable termcap init/deinit strings - sometimes these clear the screen.
  8. export LESS='-iRMX'
  9. # Try to perform syntax highlighting.
  10. # `pygments` has slightly friendlier defaults than `source-highlight`.
  11. if [[ -n $(command -v pygmentize) ]]; then
  12. export LESSOPEN="| pygmentize -g %s"
  13. elif [[ -n $(command -v src-hilite-lesspipe.sh) ]]; then
  14. export LESSOPEN="| src-hilite-lesspipe.sh %s"
  15. fi