ProblemI want to view man-pages in colour, preserving nroff's bold and italic directives. How would I edit a buffer's text and setup highlight regions:manpage_bold: For all instances of X <backspace> X:Conceal / remove the final 2 characters, leaving only the first.manpage_italic: For all instances of _ <backspace> X:Conceal / remove the leading two characters, leaving only the last.Where X is any character other than backspace.BackgroundI have less configured to display manual pages in colour:This is achieved by telling less to replace overstrikes that groff/nroff produces to indicate bold / italics with ANSI SGR colour codes.I want vim to be able to do the analogous thing: view man pages with the original bold / italics by removing the overstrikes and setting up highlight regions. OverstrikingWhat's an overstrike I hear you ask? *takes deep breath*Unix is a venerable old operating system, dating from the times when teletypes hammered inked ribbon, imprint characters on paper.Bold characters were printed by printing the character, backspacing, then printing the same character again - twice as much ink was impressed upon the paper.Italic characters are indicated by printing an underscore (_), backspace and then the character to be rendered. (source)Over 40 years later, man still uses nroff to generate the text that is displayed from the troff man page source file... and nroff still uses overstriking to indicate boldface / italics.Non-solutionsneoman and vim-man-pager only colour by regular expression- they remove the nroff bold / italic directives which are useful in warnings, etc. When using GROFF_SGR=1 to produce ANSI SGR codes rather than overstrikes, AnsiEsc is needed to display the output, and this doesn't work with set ft=man syntax highlighting.
Convert man page nroff overstrike text into highlight regions
pager