diff options
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | mnpgr.tl | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -14,6 +14,11 @@ syntax coloring, like what you see `less`. Because `mngpr` itself resolves the overstrikes, the resulting rendering in Vim is searchable. +Another benefit of `mnpgr` is that it replaces with a plain ASCII dash +(U+002D) all the nonsense Unicode dashes output by GNU groff. +This is not just esthetics. In some systems, the U+2010 hyphen +seriously corrupts the terminal display, rendering man pages unreadable. + ## Installation The `mnpgr.vim` file goes into your `~/.vim/syntax` directory, which @@ -97,7 +97,8 @@ (with-resources ((rendered-file (path-cat mnpgr-dir `@page.@section.@cols`) (remove-path rendered-file))) (with-stream (s (open-file rendered-file "w")) - (let ((ofilt (make-overstrike-filter (lambda (str) (put-string str s))))) + (let ((hfilt (op regsub #/[\x2010\x2013\x2014\x2212]/ "-")) + (ofilt (make-overstrike-filter (lambda (str) (put-string str s))))) (whilet ((line (get-line))) - [ofilt line]))) + (flow line hfilt ofilt)))) (sh `vim +'@{vim-commands}' '@{rendered-file}' < /dev/tty`)))) |