textmate 命令行_使用PHP在TextMate中创建命令

textmate 命令行

TextMate Logo

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.

这是屏幕图像,因此您具有视觉效果。

TextMate Bundle Editor

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将它们通过电子邮件发送给我, 以后我将在此博客上分享!

翻译自: https://davidwalsh.name/textmate-php

textmate 命令行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值