Last Updated: January 26, 2021
·
1.172K
· kisom

Use vim as your pager

If you want to use vim as your pager, you can use

export PAGER="col -b -x | $VIM_SHARE_DIR/macros/less.sh"

VIM_MACRO_DIR is going to vary based on your install; some places to check:

  • /usr/share/vim/vim73 (i.e., less.sh would be at /usr/share/vim/vim73/macros/less.sh
  • /usr/local/share/vim/vim73

You can set this in your profile:

vmore () {
    if [ -z "$1" ]; then
        echo "missing filename!"
        return
    fi
    cat $1 | $PAGER
}