#!/bin/sh # Display manpages using vim with raw ansi code stripping # Return on a manpage reference will open it (only basic less commands) /usr/bin/man $* -P "\ sed -e 's:\x1B\[[[:digit:]]\+m::g' | \ view - \ -c 'set viminfo= nows noma ft=man nomod nolist' \ -c 'map gg' \ -c 'map G' \ -c 'map q :q' \ -c 'map ' \ -c 'map b ' \ -c \"let \\\$MANPAGER = \\\"sed -e 's:\\\\\x1B\\\\\[[[:digit:]]\\\\\+m::g'\\\"\"\ -c 'nmap :Man =expand(\"\")' \ " # Be as much less compatible as possible (incompatible with :Man calls) #/usr/bin/man $* -P "\ # sed -e 's:\x1B\[[[:digit:]]\+m::g' | \ # view - \ # -c 'runtime! macros/less.vim' \ # -c 'map gg' \ # -c 'map G' \ # -c 'set ft=man nolist' \ # -c \"let \\\$MANPAGER = \\\"sed -e 's:\\\\\x1B\\\\\[[[:digit:]]\\\\\+m::g'\\\"\" \ # "