什么是一个很好的设置在Emacs编辑PHP? [英] What is a good setup for editing PHP in Emacs?

查看:147
本文介绍了什么是一个很好的设置在Emacs编辑PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将做我的工作一些PHP编辑这个夏天,和我在寻找一个有效的Emacs的设置编辑它。我已经投入巨资在Emacs,所以切换到另一个编辑器是不值得的。

I'm going to be doing some PHP editing for my job this summer, and am looking for an effective Emacs setup for editing it. I'm already heavily invested in Emacs, so switching to another editor is not worthwhile.

现在,我有 nXhtml模式,它提供了PHP模式语法高亮(有在野外的至少三个不同的),以及MuMaMo嵌入在HTML编辑PHP的。我刚开始使用自动完成和的任何用于编程和一般的Emacs的东西,分别为。

Right now, I have nXhtml-mode, which provides a PHP mode with syntax highlighting (there are at least three different ones in the wild) as well as MuMaMo for editing PHP embedded in HTML. I just started using Auto-Complete and Anything for programming and general Emacs stuff, respectively.

我真正追求的是让Emacs的真正理解这个项目,不仅仅是突出的有效途径。 ETag时看起来像一个不错的选择,但它看起来像生成新的标签的过程是怎么样的艰辛和手动(或至少不是不可见)。有关ETag时的好处是,他们有任何事情,自动完成很好地集成。其他潜在的选项是 gtags (虽然我犹豫要安装非elisp的文件,只是为复杂性),<一个HREF =htt​​p://www.emacswiki.org/cgi-bin/wiki/VTags> vtags ,或语义,我已经搞砸之前和看似复杂设置,再加上它看起来并不像它支持PHP。

What I'm really looking for is an effective way to get Emacs to really understand the project, beyond just highlighting. Etags looks like a good option, but it looks like the process for generating new tags is kind of arduous and manual (or at least not invisible). The nice thing about Etags is that they integrate well with Anything and Auto-Complete. Other potential options are gtags (though I'm hesitant to install non-elisp files, just for the complexity), vtags, or Semantic, which I've messed with before and seems complicated to set up, plus it doesn't look like it has support for PHP.

另一个选择是 Imenu ,但它仅适用于当前缓冲区,我也希望能够跳在其他文件(preferably使用的名称完成任何东西)。

Another option is Imenu, but it only works for the current buffer, and I would like to be able to jump to function definitions in other files (preferably using Anything for completion of the name).

我将工作的项目是没有那么大(约30000行总),所以ETag时的开销,可能不会有什么大问题的,但如果有一个更好的我宁可不使用它解决方案。

The projects I will be working on are not that big (about 30,000 lines total), so the overhead of Etags probably won't be that big of an issue, but I'd rather not use it if there is a better solution.

那么,什么是您的preferred PHP编辑系统?

So what is your preferred PHP editing system?

推荐答案

在除了功能,你已经很熟悉,我建议你以下几点。

In addition to features you are already familiar with, I suggest you the followings.

我不使用ETag的,但是有一个问题已经在SO的 How以编程方式创建/更新使用Emacs标签文件 的。没有很好的答案被张贴,虽然,但它可能是一个很好的切入点,以得到一个想法。

I do not use ETags, but there is a question already on SO How to programmatically create/update a TAGS file with emacs. No good answer was posted, though, but it may be a good entry point to get an idea.

Flymake 是一个模式,以获得动态语法检查。它有PHP支持。它暗示了语法错误,立即在您键入。附带的Emacs 23 Flymake版本包含PHP支持。如果你有previous版本,请检查萨沙蔡氏职位上的 Emacs和PHP:在即时语法检查Flymake

Flymake is a mode to get on the fly syntax checking. It has support for PHP as well. It hints at syntax errors immediately as you type. The Flymake version shipped with Emacs 23 contains PHP support. If you have previous version, check Sacha Chua's post on Emacs and PHP: On-the-fly syntax checking with Flymake.

另一个有用的包是 Geben ,让您交互式地调试脚本。对于PHP,可以使用了XDebug。对于如何做到这一点的详细教程,请参阅与geben

Another useful package is Geben that allows you to debug your scripts interactively. For PHP, you can use XDebug. There is a detailed tutorial on how to do that, see Debug php in emacs with geben.

PHP模式有一个很好的功能来查找函数在PHP手册定义你的浏览器(的Mx PHP-搜索文档抄送比照)。你可以用的Emacs W3M 结合起来,以获得相关的手册页不留Emacs的。

PHP Mode has a nice feature to lookup the function's definition in PHP's manual in your web browser (M-x php-search-documentation or C-c C-f). You can combine it with Emacs-W3M to get the relevant manual page without leaving Emacs.

这篇关于什么是一个很好的设置在Emacs编辑PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆