在 TextMate PHP Bundle 中自动触发语法验证
我喜欢 Text mate,但有时我确实怀念一些 IDE 功能。
其中之一是能够在您键入时或在按 Enter 或箭头键等离开一行后自动检查语法。
在 textmate 的 PHP Bundle 中,您可以使用 Control-Shift-V 键盘快捷键检查语法。这很棒,但这需要用户输入。我知道有些人可能会说懒惰,但我只是想最大限度地提高编码速度,而不必停下来运行检查。
有没有办法让这个命令在返回或离开当前行时自动触发?现在语法错误显示为tootlip,是否可以更改以在线显示错误类型? (语法颜色主题类型中的错误)。
I love text mate, but sometimes I do miss some IDE features.
One of which is the ability to automatically check syntax as you type or after you hit enter or the arrow keys etc to leave a line.
in textmate's PHP Bundle you can check the syntax using the Control-Shift-V keyboard shortcut. Which is great, but That requires user input. I know some may say lazy, but I just like to maximize my coding speed and not have to stop to run checks.
is there a way to get this command to auto trigger on either Returns or leaving the current line? right now the syntax error shows up as a tootlip, could this be changed to display an error type on the line? (error as in the syntax color theme type).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要让验证语法命令在每次返回时执行,您可以录制一个宏。录制时,执行验证语法命令并按回车键。保存您的宏并给它一个相当于返回键的键。现在,当您按回车键时,它将覆盖简单插入回车符的默认行为,而是运行命令,然后插入回车符。由于您可能不希望这种情况总是发生(例如,如果您正在编辑非 PHP 文件),请将宏的范围设置为
source.php
。要使错误出现在文件中而不是工具提示中,您需要编辑现有的“验证语法”命令或复制它并使用副本代替,并将输出设置为“插入为文本”而不是“显示为工具提示”。
To have the Validate Syntax command execute with each return you could record a macro. While recording, execute the validate syntax command and press return. Save your macro and give it a key equivalent of the return key. Now when you press return it's going to override the default behavior of simply inserting a return and instead run the command and then insert the return. Since you probably don't want this to always happen (for example, if you're editing non-PHP files) set the scope of the macro to
source.php
.To have the error appear within the file instead of within a tooltip, you're going to need to either edit the existing Validate Syntax command or duplicate it and use the duplicate instead, with the output set to Insert as Text instead of Show as Tool Tip.