Gitify the working tree.
[profile.git] / .profile.d / man.bashrc
1 # Use vim for manpages and infopages.
2 # Requires vim 5+ and info.vim plugin.
3 #
4
5 vimmajor=$(vim --help 2>&1 | head -n 1 | sed 's/^VIM[^0-9]*\([0-9]*\)\..*/\1/')
6
7 function vman() {
8   vim -c "runtime ftplugin/man.vim" -c "Man ${1-man}" \
9       -c "set nolist noruler ls=0" +"wincmd o"
10 }
11
12 function vinfo() {
13   vim -c "Info ${1-info}" \
14       -c "set nolist noruler ls=0" +"wincmd o"
15 }
16
17 if [ ! -z "$vimmajor" -a $vimmajor -gt 4 ]; then
18   alias man=vman
19   alias info=vinfo
20 fi
21
22 unset vimmajor