textmate 命令行
TextMate is the best thing to enter my programming life since MooTools. TextMate is extremely flexible and contains a host of functions that make my programming time much more efficient. Snippets, commands, macros -- TextMate has it all. And when a command or snippet doesn't exist, write it yourself! In what language? Any language installed on your system! TextMate's so flexible that you can write commands in the language you feel most comfortable in.
自MooTools以来,TextMate是进入我的编程生涯的最佳选择。 TextMate非常灵活,并且包含许多功能,这些功能使我的编程时间更加高效。 片段,命令,宏-TextMate拥有了一切。 当命令或代码段不存在时,请自己编写! 用什么语言? 您的系统上安装了任何语言! TextMate非常灵活,您可以使用最舒适的语言编写命令。
Textmate命令/ PHP (The Textmate Command / PHP)
The first thing we do is tell the command "textarea" that our command is going to be coded in PHP:
我们要做的第一件事是告诉命令“ textarea”,我们的命令将用PHP编码:
#!/usr/bin/env php
Next we read in the content of the current buffer:
接下来,我们读入当前缓冲区的内容:
<?php
$content = file_get_contents('php://stdin');
Then...we add any PHP we want to modify the buffer contents. When the buffer content has been modified as desired, you echo out the content and the buffer's content is replaced:
然后...我们添加任何我们想要修改缓冲区内容PHP。 根据需要修改缓冲区内容后,您将回显该内容并替换缓冲区的内容:
//do whatever you want here
$content = str_replace('MooTools','MooTools FTW!',$content);
//echo out modified content
echo $content;
?>
Here's an image of the screen so you have a visual.
这是屏幕图像,因此您具有视觉效果。
Have any TextMate commands you've created? Email them to me at david@davidwalsh.name and I'll share them on this blog in the future!
您已创建任何TextMate命令吗? 通过david@davidwalsh.name将它们通过电子邮件发送给我, 以后我将在此博客上分享!
textmate 命令行