Created
August 10, 2012 08:26
-
-
Save bobrik/3312595 to your computer and use it in GitHub Desktop.
rmate as $PAGER shell variable (instead of less or whatever you use)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# EDITOR should be set to rmate | |
# Usage: git diff | rmatein | |
# First arg may be set to file extension to hint rmate about file type | |
if [ -n "${1}" ]; then | |
POSTFIX=".${1}" | |
fi | |
TMP_FILE=$( mktemp "/tmp/rmateXXXXXXXX${POSTFIX}" ) | |
cat /dev/stdin | ansifilter > $TMP_FILE | |
$EDITOR $TMP_FILE | |
rm $TMP_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment