开发者

Automatically trigger Syntax Validation in TextMate PHP Bundle

开发者 https://www.devze.com 2023-03-05 01:09 出处:网络
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.

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 Bund开发者_如何转开发le 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).


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.

Automatically trigger Syntax Validation in TextMate PHP Bundle

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消