From 05f2b2bb861bc545d08a7fcd53c0ba3eed3839e9 Mon Sep 17 00:00:00 2001 From: Nick Plekhanov Date: Wed, 30 Mar 2016 20:49:08 +0200 Subject: [PATCH] zshrc: Less as a default pager --- install/brew.sh | 1 + shell/shell_exports | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/install/brew.sh b/install/brew.sh index 146cae3..3f76d0a 100644 --- a/install/brew.sh +++ b/install/brew.sh @@ -66,6 +66,7 @@ apps=( autojump imagemagick --with-webp python + source-highlight the_silver_searcher tree ffmpeg --with-libvpx diff --git a/shell/shell_exports b/shell/shell_exports index 1954aab..abfdb3d 100644 --- a/shell/shell_exports +++ b/shell/shell_exports @@ -21,6 +21,31 @@ export MANPAGER="less -X" # Make less the default pager, add some options and enable syntax highlight using source-highlight LESSPIPE=`which src-hilite-lesspipe.sh` [ -n "$LESSPIPE" ] && export LESSOPEN="| ${LESSPIPE} %s" +less_options=( + # If the entire text fits on one screen, just show it and quit. (Be more + # like "cat" and less like "more".) + --quit-if-one-screen + + # Do not clear the screen first. + --no-init + + # Like "smartcase" in Vim: ignore case unless the search pattern is mixed. + --ignore-case + + # Do not automatically wrap long lines. + --chop-long-lines + + # Allow ANSI colour escapes, but no other escapes. + --RAW-CONTROL-CHARS + + # Do not ring the bell when trying to scroll past the end of the buffer. + --quiet + + # Do not complain when we are on a dumb terminal. + --dumb +); +export LESS="${less_options[*]}" +export PAGER='less' export HOMEBREW_CASK_OPTS="--appdir=/Applications"