Enabling php-mode and syntax highlighting in Emacs
Sometimes I am forced to edit PHP files outside Eclipse. Here’s a quick guide to make your text editor (in this case, Emacs) a little more user friendly by enabled php-mode and syntax highlighting.
First download php-mode and stick it in your ~/.emacs.d folder:
Next paste the following code into your ~/.emacs file. This will enable php-mode and syntax highlighting. As you can see, I also added a default file extension for .module files.
Now when you open .php or .module files, your code will be syntax highlighted and emacs will be tailored to editing PHP code. Screen shot:
Updated: 2013-04-02
If you want to enable syntax highlighting on vim (mac osx):
Check out Tomorrow Theme (which I use primary with Sublime Text).
-
Download the package and copy Tomorrow-Night.vim to /usr/share/vim/vim73/colors.
-
Added a ~/.vimrc file with:
syntax on colo Tomorrow-Night
For Ubuntu: