]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - vim/vim/after/syntax/perl.vim
vim: after/syntax/perl.vim: highlight die/exit as statementControl
[config/dotfiles.git] / vim / vim / after / syntax / perl.vim
1 " Vim syntax file
2 "
3 " Language:     Perl
4 " Maintainer:   Simon Ruderich <simon@ruderich.org>
5 " License:      GPL v3+
6
7 " Copyright (C) 2012-2018  Simon Ruderich
8 "
9 " This file is free software: you can redistribute it and/or modify
10 " it under the terms of the GNU General Public License as published by
11 " the Free Software Foundation, either version 3 of the License, or
12 " (at your option) any later version.
13 "
14 " This file is distributed in the hope that it will be useful,
15 " but WITHOUT ANY WARRANTY; without even the implied warranty of
16 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 " GNU General Public License for more details.
18 "
19 " You should have received a copy of the GNU General Public License
20 " along with this file.  If not, see <http://www.gnu.org/licenses/>.
21
22
23 " Use SpecialComment to highlight shebangs.
24 highlight link perlSharpBang SpecialComment
25
26 " I never use continue and break, and always confuse them with next and last.
27 syntax match Error "\<\(continue\|break\)\>"
28
29 " Highlight statement control keywords differently when my color scheme is
30 " used.
31 if exists('g:colors_name') && g:colors_name == 'simon'
32     highlight link perlStatementControl statementControl
33     " die/exit is also kind of "statement control" as it terminates the
34     " program.
35     syn match statementControl "\<\%(die\|exit\)\>"
36 endif
37
38 " Highlight for Inline::C in __DATA__/__END__ section
39 unlet b:current_syntax
40 syntax include @InlineC syntax/c.vim
41 syntax region perlInlineC start='^__C__$' skip='.' end='.' contains=@InlineC
42 syntax cluster perlDATA add=perlInlineC