From 93f0998afe7d4df6b29977e235c23eccddca7caa Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 23 Jul 2007 11:41:09 +0200 Subject: [PATCH] Support LESS_TERMCAP_* --- debian/changelog | 2 ++ etc/skel/.zshrc | 8 +++++--- etc/zsh/zshenv | 11 ++++++++++- etc/zsh/zshrc | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5aad68f..e4472f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ grml-etc-core (0.3.17) unstable; urgency=low * /etc/skel/.zshrc: - added function weather() to retrieve weather information on the console + - use mostlike manpage browser only if LESS_TERMCAP_* is not set * /etc/zsh/zshrc: - added alias S for screen - alias s for ssh @@ -12,6 +13,7 @@ grml-etc-core (0.3.17) unstable; urgency=low (thanks for reporting the issue, Kevin Krammer!) * /etc/zsh/zshenv: - check for presence of lesspipe[.sh] before setting $LESSOPEN + - added LESS_TERMCAP_* * /etc/skel/.vimrc: - deactivate digraph option causing too many headaches for people not being used to that option diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 187e254..9c7fb60 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Don Mai 31 17:19:00 CEST 2007 [mika] +# Latest change: Mon Jul 23 11:40:12 CEST 2007 [mika] ################################################################################ # source ~/.zshrc.global {{{ @@ -213,8 +213,10 @@ alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' alias insecscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' -# use colors when browsing man pages (if not using pinfo or PAGER=most) - [ -d ~/.terminfo/ ] && alias man='TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man' +# use colors when browsing man pages, but only if not using LESS_TERMCAP_* from /etc/zsh/zshenv: + if [ -z "$LESS_TERMCAP_md" ] ; then + [ -d ~/.terminfo/ ] && alias man='TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man' + fi # check whether Debian's package management (dpkg) is running if type salias &>/dev/null ; then diff --git a/etc/zsh/zshenv b/etc/zsh/zshenv index a067915..93988c0 100644 --- a/etc/zsh/zshenv +++ b/etc/zsh/zshenv @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Jul 17 23:23:26 CEST 2007 [mika] +# Latest change: Mon Jul 23 11:37:26 CEST 2007 [mika] ################################################################################ # This file is sourced on all invocations of the shell. # It is the 1st file zsh reads; it's read for every shell, @@ -77,6 +77,15 @@ fi export READNULLCMD=${PAGER:-/usr/bin/pager} +# support termcap colors when using PAGER=less: + export LESS_TERMCAP_mb=$'\E[01;31m' + export LESS_TERMCAP_md=$'\E[01;31m' + export LESS_TERMCAP_me=$'\E[0m' + export LESS_TERMCAP_se=$'\E[0m' + export LESS_TERMCAP_so=$'\E[01;44;33m' + export LESS_TERMCAP_ue=$'\E[0m' + export LESS_TERMCAP_us=$'\E[01;32m' + # allow zeroconf for distcc export DISTCC_HOSTS="+zeroconf" diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index a31cb8a..0d85b3e 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -235,7 +235,6 @@ export MAIL=${MAIL:-/var/mail/$USER} # if we don't set $SHELL then aterm, rxvt,.. will use /bin/sh or /bin/bash :-/ export SHELL='/bin/zsh' - [[ -f ~/.terminfo/m/mostlike ]] && MYLESS='LESS=C TERMINFO=~/.terminfo TERM=mostlike less' || MYLESS='less' [ -x $(which dircolors) ] && eval `dircolors -b` # Search path for the cd command @@ -1255,6 +1254,7 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." else manzsh() { /usr/bin/man zshall | vim -c "se ft=man| se hlsearch" +/"$1" - ; } # manzsh() { /usr/bin/man zshall | most +/"$1" ; } + # [[ -f ~/.terminfo/m/mostlike ]] && MYLESS='LESS=C TERMINFO=~/.terminfo TERM=mostlike less' || MYLESS='less' # manzsh() { man zshall | $MYLESS -p $1 ; } fi -- 2.1.4