Emacs 的 PHP 语法荧光笔
Emacs 有没有好的 php 语法荧光笔?我正在使用 Emacs 23。我尝试过 php-mode,但这没有任何作用。我已经尝试过 nXhtml,但这忽略了我的颜色主题并恢复到一些可怕的寻找默认。是否有一个我错过了或者我忽略了一个配置设置?
Is there a good php syntax highlighter for Emacs? I'm using Emacs 23. I've tried php-mode, but that doesn't do anything. I've tried nXhtml, but that ignores my color theme and reverts to some awful looking default. Is there one I've missed or perhaps a configuration setting I've ignored?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我用了这个 http://www.emacswiki.org/emacs/php- mode-improved.el 有时。但我又切换回了 nxhtml,因为这些天我必须编辑太多混杂的 php/html/js/css 文件。
我尝试了 deboutv 之一,但它在 emacs 上 sux (它是为 xemacs 创建的)并且开发已经停止了一段时间,留下了一些严重的错误。
您应该尝试 emacswiki 上提供的模式,看看其中一种是否足够适合您。如果没有,那么,您知道该怎么做:创建自己的。
I used this one http://www.emacswiki.org/emacs/php-mode-improved.el for some times. But I switched back to nxhtml as I have to edit too many badly mixed php/html/js/css files these days.
I tried the deboutv one but it sux on emacs (it was created for xemacs) and the development has been dead for some time with some bad bugs left.
You should try the modes available on emacswiki and see if one is good enough for you. If not, well, you know what to do : create your own.
您链接到的 php-mode 肯定提供了语法突出显示。如果它“没有做任何事情”,那么你没有正确安装它。您可能需要重新检查您的配置。
The php-mode you linked to most definitely provides syntax highlighting. If it "doesn't do anything", then you didn't install it correctly. You might want to re-check your configuration.
我认为 nXhtml 不会对你的颜色主题做任何事情。相反,您的颜色主题不知道 nXhtml 在不同主要模式的块上放置的背景颜色。
不同的背景颜色是为了让您知道您在 html 部分中具有 Emacs html 编辑的全部功能,以及在 php 部分中使用的 php 编辑模式的功能。
如果您愿意,您可以告诉 nXhtml 不要为背景着色。
I think that nXhtml does not do anything with your color theme. It is rather your color theme that does not know about the background colors that nXhtml put on chunks with different major modes.
The different background colors are there so that you will be aware that you have the full capabilities of Emacs html editing in the html parts and the capabilities of the php editing mode you are using in the php parts.
You can just tell nXhtml to not color the background if you prefer that.