EMACS abilitare PHP mode con syntax highlighting!!!

horus's picture

Salve a tutti!!
essendomi da qualche tempo cimentato col PHP ed essendo un linux hard user non potevo far altro che iniziare a fare i miei primi lavori in php usando EMACS (grazie Stallman!!) e con non poche difficolta' sono riuscito ad abilitare il php-mode e il syntax highlighting. vi spiego come fare:

per prima cosa scaricatevi lo script php-mode.el (mi sembra che l'ultima versione attualmente sia la 1.5 eccovi il link per il download http://sourceforge.net/projects/php-mode/
fatto questo aprite la vostra bella shell e cscompattate l'archivio:
tar xvzf php-mode-1.5.0.tgz (il nome esatto del pacchetto)
dopo averlo scompattato prendete il file php-mode.el e copiatelo nella directory nascosta ~/.emacs.d che sta' nella vostra home:
una volta copiato l'estensione aprite il file .emacs
sudo gedit .emacs
ed aggiungete le seguenti linee:

;; Activate php-mode for php scripts
(add-to-list 'load-path "~/.emacs.d")
(setq auto-mode-alist (cons '("\\.php$" . html-mode)
auto-mode-alist))
(global-font-lock-mode t)
(add-hook 'font-lock-mode-hook
(lambda () (setq font-lock-maximum-decoration t)))

fatto questo create con emacs un file con estensione php
antonio@-:~$emacs ciao.php
e adesso emacs riconoscera' l'estensione del file e attivera' il syntax highlighting!!
a presto!!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Syndicate content