This Emacs package provides font highlighting of all native and user defined
PHP functions within php-mode
.
A piece of code without php-fh
loaded :
The same piece of code with php-fh
loaded :
This package make the fontification of the functions name by regexp using the Emacs
Lisp function font-lock-add-keywords
; this can slow down
your computer.
So, do not use this package if you have a computer with low CPU.
This package is not part of Melpa for now, waiting for maturity…
This package requires that the php-mode package was installed.
To install php-fh
, place/clone the php-fh
directory in a
directory of your choice, add it to your load path and require
php-fh
writing this code in your Emacs configuration file (.emacs
?) :
(add-to-list 'load-path "/place/where/you/put/php-fh")
(require 'php-fh)
(eval-after-load 'php-mode '(php-fh-highlight))
Either evaluate each statements individuality with C-x C-e
or restart Emacs.
With Doom Emacs
- In the file
packages.el
place this code :(package! php-fh :recipe (:host github :repo "pivaldi/php-fh"))
- In the file
config.el
place this code :(use-package! php-fh :defer t :autoload (php-fh-highlight) :init (after! php-mode (php-fh-highlight)))
- Launch the command
doom sync
and restart Doom Emacs.
php-fh-user-functions-name
: list of PHP user defined functions thatphp-fh
must also highlight.php-fh-php-generate-funcs-code
: the PHP code used to generate all internal PHP functions.php-fh-php-cmd
: The PHP command.
In order to regenerate the list of native PHP function used by php-hf
, use
the Emacs command php-fh-generate-php-func-file
(M-x etc…
).