From 38d257d50797f612c8876b85d807e770d38a4081 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 3 Oct 2012 09:51:06 +0200 Subject: remove copy of vimpager Signed-off-by: Florian Pritz --- vimpager | 79 ---------------------------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100755 vimpager diff --git a/vimpager b/vimpager deleted file mode 100755 index 1fe5328..0000000 --- a/vimpager +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -# Script for using ViM as a PAGER. -# Based on Bram's less.sh. -# Version 1.4.3 -# git://github.com/rkitover/vimpager.git - -# Just pass through if not on a tty -if [ ! -t 1 ]; then - exec cat "$@" -fi - -case `uname -s` in - Cygwin) cygwin=1 ;; - Linux) linux=1 ;; - SunOS) solaris=1 ;; - *) bsd=1 ;; -esac - -less_vim() { - vim -R \ - -c 'let no_plugin_maps = 1' \ - -c 'set scrolloff=999' \ - -c 'runtime! macros/less.vim' \ - -c 'set foldlevel=999' \ - -c 'set mouse=a' \ - -c 'set nonu' \ - -c 'nmap u :nohlsearch' \ - "${@:--}" -} - -awk_pstree() { - awk -v mypid=$1 '{ - cmd[$1]=$3 - ppid[$1]=$2 - } - END { - while (mypid != 1 && cmd[mypid]) { - ptree=mypid " " cmd[mypid] "\n" ptree - mypid=ppid[mypid] - } - print ptree - }' -} - -do_ptree() { - if [ $solaris ]; then - # Tested on Solaris 8 and 10 - ptree $$ - else - # Tested on Linux and OS X - ps awo pid=,ppid=,comm= | awk_pstree $$ - fi -} - -# Check if called from man, perldoc or pydoc -ptree="`do_ptree`" -if echo "$ptree" | awk '$2 ~ /(^|\/)(man|perl(doc)?([0-9.]*)?|py(thon|doc|doc2))/ {t=1} END { exit 1-t }'; then - sed -e 's/\[[^m]*m//g' -e 's/.//g' "${@:--}" \ - | less_vim -c 'set ft=man' -c "set nonumber" - - exit -fi - -case "$@" in - *.gz) gunzip -c "${@:--}" | sed -e 's/\[[^m]*m//g' -e 's/.//g' | less_vim - ;; - *.Z) uncompress -c "${@:--}" | sed -e 's/\[[^m]*m//g' -e 's/.//g' | less_vim - ;; - *) sed -e 's/\[[^m]*m//g' -e 's/.//g' "${@:--}" | less_vim - ;; -esac - - -# CONTRIBUTORS: -# -# Rafael Kitover -# Antonio Ospite -# Jean-Marie Gaillourdet -# Perry Hargrave -# Koen Smits -# Ivan S. Freitas -# Wout Mertens (Solaris compatibility, less processes) -- cgit v1.2.3-24-g4f1b