从 Vim 编译 Actionscript
不久前我从 Textmate 切换到 Vim,但我怀念 Textmate 的 Actionscript 捆绑包 — 具体地说是直接从 Textmate 编译 Actionscript 的能力。
有没有人找到直接从 Vim 编译 Actionscript 的方法?
I switched to Vim from Textmate a while back but I miss the Actionscript bundle for Textmate—particulate the ability to compile Actionscript directly from Textmate.
Has anyone found a way to compile Actionscript directly from Vim?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,从 Vim 编译 AS3 非常容易。
一种基本方法,假设您打开了
main.as
文件并且处于--NORMAL--
模式,请键入以下内容:以获取
main.swfmain.as
旁边的 code> 文件或:获取
../deploy/main.swf
(相对于main.as
)。!
表示“以下是 shell 命令”。%
表示“此文件,此处,在当前缓冲区中”。%<
表示“此文件的名称,不带点和扩展名”。显然这并不是很聪明,但您可以让
mxmlc
读取配置 XML,以获得更多控制。请参阅 Flex 文档以获取可能的参数列表。使用这种方式来调试你的构建会很困难。另一种方法是将
mxmlc
设置为 ActionScript 文件的构建程序:然后,输入
:make %
来构建您的项目。错误将显示在快速修复窗口中。也就是说,使用 Vim 进行 AS3 的实际“编程”部分很糟糕,因为唯一的可用的全能完成脚本(据我所知)非常有限,多年来一直未完成(这不是对作者的攻击,必须赞扬他的努力)。
几个月前我已经开始增强该脚本,但它还远没有完成(并且优先级较低),并且与您在 Flash Builder 或 FDT 中获得的内容相比,无论如何都不是那么好。
事实上,AS3 捆绑包是我在 TextMate 时代唯一怀念的东西,它出人意料地精美。
Yes, compiling AS3 from Vim is very easy.
One basic way, assuming you have
main.as
file open and you are in--NORMAL--
mode, type this:to obtain
main.swf
file next tomain.as
or:to obtain
../deploy/main.swf
(relative tomain.as
).!
means "the following is a shell command".%
means "this file, here, in the current buffer".%<
means "this file's name without the point and the extension".Obviously it's not really smart but you can make
mxmlc
read a configuration XML, for more control. See the Flex doc for the list of possible arguments. Using this way it's going to suck a lot to debug your builds.Another way is to set
mxmlc
as the build program for actionscript files with:Then, type
:make %
to build your project. Errors will be displayed in the quickfix window.That said, the actual "programming" part of doing AS3 with Vim sucks hard because the only omni-completion script available (to my knowledge) has been very very limited and unfinished for years (it's not an attack against the author which must be praised for his efforts).
I've started to augment that script a couple of months ago but it's far from being finished (and a low level priority) and not that good anyway compared to what you may get in Flash Builder or FDT.
Actually, the AS3 bundle is the only thing I miss from my TextMate days, it was surprisingly polished.
在vim官方文档中,有一个主题叫做:"fcsh工具:你可以编译通过 fcsh 从 vim 获取 .as 和 .mxml 文件:Flex Comipler SHell”。该主题描述了编译 .as 和 .mxml 的所有过程,但正如那里所注意到的,它仅在 unix 系统上进行了测试。
In the official vim documentation, there is an topic called: "fcsh tools : you can compile .as and .mxml files from vim via fcsh : Flex Comipler SHell". That topic describe all process of compilation .as and .mxml, but as noticed there, it tested only on unix systems.
如果你想在 vim 上使用 FCSH,请查看 https:// github.com/lucasdupin/vim-utils/blob/master/bin/fcshd - 它的工作方式与 TextMate 上的 FCSH 守护程序完全相同。
If you want to use FCSH on vim, take a look on https://github.com/lucasdupin/vim-utils/blob/master/bin/fcshd - it works exactly like the FCSH daemon you have on TextMate.