.config/nvim/after/syntax/perl/custom.vim

Thu, 02 Mar 2023 21:15:29 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 02 Mar 2023 21:15:29 -0600
changeset 1058
c8754b0414b9
parent 1029
9265f8508e4c
permissions
-rw-r--r--

add bundled languages to avoid errors

" this keeps indents from jumping more than one level
let b:indent_use_syntax = 0

syn sync minlines=1500

" Weird behavior in sql heredocs
syn clear sqlFold

" fix highlight-all-pragma for vN.NN
syn match perlStatementInclude   "\<\%(use\|no\)\s\+v\(\d\|.\)\+"

" Add match for =method and =func from Pod::Weaver
syn match podCommand "^=method" contained nextgroup=podCmdText contains=@NoSpell
syn match podCommand "^=func" contained nextgroup=podCmdText contains=@NoSpell

" Add matches for contrib/function-parameters.vim, but don't apply to fat-arrow cases
syn match perlFunction +\<method\>\(\_s*=>\)\@!\_s*+ nextgroup=perlSubName
syn match perlFunction +\<fun\>\(\_s*=>\)\@!\_s*+ nextgroup=perlSubName

" Tweak some colors, making POD stand out less
hi! def link perlPOD      Comment
hi! def link podOrdinary  Comment
hi! def link podCommand   SpecialComment
hi! def link podCmdText   Question
hi! def link podFormat    StorageClass

syntax region perlHereDocSQL matchgroup=perlStringStartEnd start=+<<\~\s*'\z(\%(END_\)\=SQL\)'+ end='^\s*\z1$' contains=@SQL
syntax region perlHereDocSQL matchgroup=perlStringStartEnd start='<<\~\s*"\z(\%(END_\)\=SQL\)"' end='^\s*\z1$' contains=@perlInterpDQ,@SQL
syntax region perlHereDocSQL matchgroup=perlStringStartEnd start='<<\~\s*\z(\%(END_\)\=SQL\)'   end='^\s*\z1$' contains=@perlInterpDQ,@SQL

mercurial