From 4568d43507bcd9e0964c72e6ea565eea65a92829 Mon Sep 17 00:00:00 2001 From: PHO Date: Fri, 24 Oct 2014 12:45:19 +0900 Subject: [PATCH] Auto commit by The Sugar System. --- dot-files/_zshrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dot-files/_zshrc b/dot-files/_zshrc index 13e764d..ff20eda 100644 --- a/dot-files/_zshrc +++ b/dot-files/_zshrc @@ -186,6 +186,22 @@ HISTFILE="$HOME/.zhistory" HISTSIZE=6000000 SAVEHIST=6000000 +function lv() { + local -a lv_cmd + + if whence -p lv >/dev/null; then + lv_cmd=("lv") + elif which less >&/dev/null; then + lv_cmd=("less") + elif which more >&/dev/null; then + lv_cmd=("more") + else + echo >&2 "$0: no pager commands are found" + fi + + command "${lv_cmd[@]}" "$@" +} + alias -g L="| $PAGER" alias -g G="| grep" alias -g H="| head" -- 2.40.0