Wednesday, February 6, 2008

Charged php-mode for Emacs and something more

Case the official maintainers of the php-mode seems to be busy people I public it here.

This is a charged php-mode for Emacs. I mean it's the freshest php-mode with some fixes/updates/improvements which I've written for myself and now I share with you.

It's based on the latest php-mode version 1.4.0-beta and contains all the original features and adds some new

1) Fixes in the code highlighting, especially in_the_underscored_functions
2) Added the php's built-in functions highlighting
3) Added the php-doc tags highlighting like @param @return, TODO, FIXME etc.
4) Added a hotkey and functionality to execute the current php-buffer with usual C-c C-c command
5) Added a hotkey and functionality to execute the current buffer with the phpunit util (C-c C-p C-u command)
6) Some another highlighting fixes/improvements

This is the screenshot (click to see the full version). Hope it's not too much beautiful to you ;)

Get it here

And as I mentioned there's more

There's another sweet stuff for php-editing which had to exists but somehow didn't. It's a php-electric mode. Similar to another -electric modes for emacs, it put some hot magic under your fingers and creates language constructions for you when you type.

Try, you will like it. It's simple but handy and have the following features

* autocompletion for the if/for/foreach etc blocks
* autocompletion for the classes/interfaces/functions
* autocompletion for paired symbols like [] () "" ''

You can get it here

Both files might be easily inserted into your system. Just put them where emacs can see them (say in ~/.emacs.d/) and insert into your emacs config couple of strings like that.

(require 'php-mode)
(require 'php-electric)

That's it have fun!


Jeff Long said...

For php-mode.el in Emacs 21.3.1 I got an emacs error - "Invalid escape character syntax". A little google magic helped me find out that a '\s' needed to be '\\s', in case anyone else tries it out and runs in to that problem, easy fix. Thanks!

Travis Jeffery said...

These are great, thanks.

hoi said...

I loved you highlighting color-scheme.
How can I get it?

Nikolay V. Nemshilov aka St. said...

this is a theme from the standard color-theme package, called 'Deep Blue'

(require 'color-theme)