Browse Source

zshrc: Less as a default pager

master
Nick Plekhanov 9 years ago
parent
commit
05f2b2bb86
  1. 1
      install/brew.sh
  2. 25
      shell/shell_exports

1
install/brew.sh

@ -66,6 +66,7 @@ apps=(
autojump
imagemagick --with-webp
python
source-highlight
the_silver_searcher
tree
ffmpeg --with-libvpx

25
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"

Loading…
Cancel
Save