Closed zonuexe closed 1 year ago
Note This is an experimental feature. We are looking for your feedback to improve the usability.
This feature is for execute PHP code formatting tools.
It supports both per-project and globally installed ones.
Add following line to setup function for php-mode.
(php-format-auto-mode +1)
These variables can be set either by dir-locals.el or by custom-set-variable.
php-format-auto-mode-hook-depth
php-format-command
php-format-command-dir
php-format-default-idle-time
php-format-result-display-method-alist
How formatting is performed and how the results are displayed can be controlled by the following keywords.
idle
async
compile
silent
nil
This feature is for execute PHP code formatting tools.
Supported tools:
It supports both per-project and globally installed ones.
How to use
Add following line to setup function for php-mode.
Customization
These variables can be set either by dir-locals.el or by custom-set-variable.
php-format-auto-mode-hook-depth
php-format-command
php-format-command-dir
php-format-default-idle-time
php-format-result-display-method-alist
Display methods
How formatting is performed and how the results are displayed can be controlled by the following keywords.
idle
: Asynchronously apply formatting to idle time in Emacs using `run-with-idle-timer'async
: Immediately execute an asynchronous process to apply formattingcompile
: Apply formatting using the compile command. Doesn't lock, but results pop upsilent
: Apply formatting immediately and synchronously. No message is displayed, but Emacs is locked while it is being processed.nil
: Apply formatting immediately and synchronously. Emacs will be locked until formatting is done and the result will pop up.