Home > update_perl_line_directives

update_perl_line_directives

Update_perl_line_directives is a project mainly written in Vim Script, it's free.

automatically add/update line directives in perl embedded in vim scripts

This is a mirror of http://www.vim.org/scripts/script.php?script_id=3406

WARNING: if your vim links to (or dlopenes) a libperl earlier than 5.12, perl may end up lying to you about the line number by one (or maybe more, but one is what I've seen).

This script eases development of vim scripts that use embedded perl code by automatically adding or updating line directives to perl code blocks. So for example:

 perl <<EOF

will automagically become

 perl <<EOF
 # line 42 /some/file.vim

when you save /some/file.vim. You can use other valid here-document terminators, not just 'EOF'.

Now your error messages that come from perl will have correct file names and line numbers.

See also http://www.vim.org/scripts/script.php?script_id=3411 if you want to automatically catch perl syntax errors when vim scripts are saved.