perl - 在 Vim 中使用 quickfix 编译 Perl

标签 perl vim

好吧,这不是关于完全编译,但最近我发现了 :compiler Vim 中的命令。该帮助包含在 quickfix 文档中,据我所知,我可以运行:

:compiler perl

选择 perl 解释器。然后,帮助说:

The Perl compiler plugin doesn't actually compile, but invokes Perl's internal syntax checking feature and parses the output for possible errors so you can correct them in quick-fix mode.



但由于目前尚不清楚我应该如何实际运行该程序。我可以运行吗:make ,即使没有制作文件?这对我来说很有意义,因为:
echo &makeprg

返回 perl -Wc % .然而…

在伪造的测试程序上执行此操作,只会返回标准错误格式输出,不会打开 Quickfix 窗口。我在这里缺少什么?

最佳答案

只需打开 quickfix 窗口

:copen

导航错误
:crew
:cnext
:cprev

请注意,使用非项目 make(即 makeprg 变量通常包含当前缓冲区的名称(扩展 % ))的quickfixing 的常见陷阱是,当焦点位于 quickfix 窗口时,再次发出 :make 将失败,因为 quickfix 缓冲区没有与之关联的文件名。也许这可以通过为快速修复窗口提供一个人工名称来解决,例如vim 的 Perl 编译器模式?

关于perl - 在 Vim 中使用 quickfix 编译 Perl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5778923/

相关文章:

perl - 是否可以将命名管道与 perl 中的 select 混合使用?

perl - 查询: Loops in Relation to Parent - Child - Fork - Pids

linux - 在我的 MAC 终端和 Vim 上设置 solarized colorscheme 时遇到问题

linux - 自定义 vim 语法高亮脚本——为什么它们在 Windows 中工作而不在 Linux 中工作?

perl - 子例程与匿名子例程上下文中的共享变量

perl - 在 Perl 中插入散列的末尾

perl - perl中localtime `time`有什么用?

vim : How to use only the "mouse scrolling" without the other feature of :set mouse=a

python - Python 中 doxygen 样式文档字符串的 Vim 语法高亮显示

vim - 当 YAML 映射键包含空格时,如何让 Vim 高亮显示它?