简体   繁体   English

Emacs的PHP语法荧光笔

[英]PHP syntax highlighter for Emacs

Is there a good php syntax highlighter for Emacs? Emacs是否有一个很好的php语法荧光笔? I'm using Emacs 23. I've tried php-mode , but that doesn't do anything. 我正在使用Emacs23。我已经尝试了php-mode ,但是没有任何作用。 I've tried nXhtml , but that ignores my color theme and reverts to some awful looking default. 我已经尝试过nXhtml ,但是它忽略了我的颜色主题,并恢复了一些可怕的默认值。 Is there one I've missed or perhaps a configuration setting I've ignored? 有没有我想念的或者是我忽略的配置设置?

I used this one http://www.emacswiki.org/emacs/php-mode-improved.el for some times. 我使用了一个http://www.emacswiki.org/emacs/php-mode-improved.el一段时间。 But I switched back to nxhtml as I have to edit too many badly mixed php/html/js/css files these days. 但是由于这些天我不得不编辑太多混合在一起的php / html / js / css文件,所以我切换回nxhtml。

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. 我尝试了deboutv,但是它在emacs上是sux(它是为xemacs创建的),开发已经死了一段时间,还留下了一些错误。

You should try the modes available on emacswiki and see if one is good enough for you. 您应该尝试emacswiki上可用的模式,看看是否足够适合您。 If not, well, you know what to do : create your own. 如果不是,那么,您知道该怎么做:创建自己的。

The php-mode you linked to most definitely provides syntax highlighting. 您链接到的php模式绝对可以提供语法突出显示功能。 If it "doesn't do anything", then you didn't install it correctly. 如果它“什么都不做”,则说明您未正确安装它。 You might want to re-check your configuration. 您可能需要重新检查配置。

I think that nXhtml does not do anything with your color theme. 我认为nXhtml对您的颜色主题没有任何作用。 It is rather your color theme that does not know about the background colors that nXhtml put on chunks with different major modes. 而是您的颜色主题不知道nXhtml使用不同主要模式放置在块上的背景颜色。

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. 那里有不同的背景颜色,因此您将意识到在html部件中具有Emacs html编辑的全部功能以及在php部件中使用的php编辑模式的功能。

You can just tell nXhtml to not color the background if you prefer that. 如果愿意,您可以告诉nXhtml不要为背景着色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM