Reputation: 1528
I have perl 5.22 (with subroutine signatures) and vim 7.4.1689. (These come standard on Ubuntu 16.04)
When I type subroutine signatures in the definition of a subroutine, I get the signature in red background, as if I typed something wrong that won't get accepted by perl.
perl runs my code fine, however.
How do I fix vim to accept the signature and not highlight it as an error?
sub sum($s, $t) {
print $s+$t, "\n";
}
Upvotes: 5
Views: 511
Reputation: 24063
Preliminary support for signature highlighting was added in February, 2014, with another tweak in July, 2014. The Perl syntax file that came with my Vim 7.4 install says it was last changed in 2013, so you'll probably need to update.
Install the latest version of vim-perl and add the following to your .vimrc:
let perl_sub_signatures = 1
Upvotes: 8