Greetings: Some man page headers and footers are not highlighted properly. Examples on Debian 10 include "man last" and "man ufw".
This commit changes the highlighting rules to always highlight the first and last lines, regardless of their form. This means that man pages that look like (in the case of "man last")... LAST, LASTB(1) User Commands LAST, LASTB(1) ... will still be highlighted correctly. Same goes for the footer. diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim index 77675c5d2..5bdba8621 100644 --- a/runtime/syntax/man.vim +++ b/runtime/syntax/man.vim @@ -3,7 +3,7 @@ " Maintainer: SungHyun Nam <gow...@gmail.com> " Previous Maintainer: Gautam H. Mudunuri <gmudu...@informatica.com> " Version Info: -" Last Change: 2015 Nov 24 +" Last Change: 2020 Apr 15 " Additional highlighting by Johannes Tanzler <johannes.tanz...@aon.at>: " * manSubHeading @@ -18,8 +18,11 @@ endif runtime! syntax/ctrlh.vim syn case ignore + +syn match manHeader '\%1l.*' +exe 'syn match manFooter ''\%' . line('$') . 'l.*''' + syn match manReference "\f\+([1-9][a-z]\=)" -syn match manTitle "^\f\+([0-9]\+[a-z]\=).*" syn match manSectionHeading "^[a-z][a-z -]*[a-z]$" syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" @@ -36,7 +39,9 @@ endif " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link manTitle Title +hi def link manHeader Title +hi def link manFooter PreProc + hi def link manSectionHeading Statement hi def link manOptionDesc Constant hi def link manLongOptionDesc Constant Thanks! -- Jason Franklin -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/6bce33f3-ed9c-351a-19f0-720a1eed6897%40quoininc.com.