Skip to content

Instantly share code, notes, and snippets.

@munky69rock
Created December 19, 2012 04:41
Show Gist options
  • Save munky69rock/4334419 to your computer and use it in GitHub Desktop.
Save munky69rock/4334419 to your computer and use it in GitHub Desktop.
vim pager
#!/bin/sh -u
set -e
# origin: http://www.songmu.jp/riji/archives/2012/05/post_379.html
# check: http://d.hatena.ne.jp/masudaK/20120223/1330006586
if [[ -p /dev/stdin ]];then
tr -d "\r" | vim -R -
else
cat <<HELP
$0
Description:
pager with vim
Usage:
[standard input] | $0
Expample:
svn diff -rhead [source] | $0
HELP
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment