From 5b77877888162f4e415fe9a7b8c5e9fb5dfb6ee1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 27 Sep 2017 20:43:42 +0200 Subject: Add syntax files from upstream vim repository --- syntax/man.vim | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 syntax/man.vim (limited to 'syntax/man.vim') diff --git a/syntax/man.vim b/syntax/man.vim new file mode 100644 index 00000000..cf24d3e2 --- /dev/null +++ b/syntax/man.vim @@ -0,0 +1,54 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vim') == -1 + +" Vim syntax file +" Language: Man page +" Maintainer: SungHyun Nam +" Previous Maintainer: Gautam H. Mudunuri +" Version Info: +" Last Change: 2015 Nov 24 + +" Additional highlighting by Johannes Tanzler : +" * manSubHeading +" * manSynopsis (only for sections 2 and 3) + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Get the CTRL-H syntax to handle backspaced text +runtime! syntax/ctrlh.vim + +syn case ignore +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*" +syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" +" syn match manHistory "^[a-z].*last change.*$" + +if getline(1) =~ '^[a-zA-Z_]\+([23])' + syntax include @cCode :p:h/c.vim + syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained + syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition +endif + + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +hi def link manTitle Title +hi def link manSectionHeading Statement +hi def link manOptionDesc Constant +hi def link manLongOptionDesc Constant +hi def link manReference PreProc +hi def link manSubHeading Function +hi def link manCFuncDefinition Function + + +let b:current_syntax = "man" + +" vim:ts=8 sts=2 sw=2: + +endif -- cgit v1.2.3