# use vim as man's pager, rely on ManPageView plugin
vman() {
/usr/bin/whatis "$@" > /dev/null
if [ $? -eq 0 ]; then
/usr/bin/vim -c "Man $@" -c 'silent! only' -c 'nmap q :q<cr>'
else
/usr/bin/man "$@"
fi
}
alias man='vman' # use vim as man's pager, rely on ManPageView plugin
vman() {
/usr/bin/whatis "$@" > /dev/null
if [ $? -eq 0 ]; then
/usr/bin/vim -c "Man $@" -c 'silent! only' -c 'nmap q :q<cr>'
else
/usr/bin/man "$@"
fi
}
alias man='vman'Links:
[1] http://www.yyhh.org/user/huahai
[2] http://www.yyhh.org/knowledge/software/linux
[3] http://www.yyhh.org/knowledge/software/vim
[4] http://vim.sourceforge.net/tips/tip.php?tip_id=167
[5] http://vim.sourceforge.net/scripts/script.php?script_id=489