Ⅰ. 插件描述
automatically add/update line directives in perl embedded in vim scriptsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/update-perl-line-directives'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/update-perl-line-directives'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/update-perl-line-directives'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/update_perl_line_directives
Ⅳ. 文档说明
WARNING: if your vim links to (or dlopen()'s) 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.