Questions tagged [php-mode]
31 questions
11
votes
1 answer
How do I set up key bindings for modes in a specific Evil state?
I have a set of key bindings that I use for both web-mode and php-mode in insert mode (of Evil). So I cannot use set-local-map or something. Because in normal mode, the same keys will then call other commands. So the bindings need to be active in…

ReneFroger
- 3,855
- 22
- 63
7
votes
2 answers
"Symbol's function definition is void: cl-macroexpand-all" when trying to install php-mode
I'm trying to install php-mode, but I keep encountering this error when I run M-x php-mode:
Symbol's function definition is void: cl-macroexpand-all
The error persists whether I install php-mode via MELPA or manually.
Environment: Emacs 24.3.94.1…

cg433n
- 285
- 2
- 6
6
votes
2 answers
PHP intellisense in emacs
Is it possible to obtain a package which supports Intellisense PHP in emacs?
As I've set up cedet now and I would like to add autocomplete for PHP code in emacs.
I know you can do it in vim.

paula
- 71
- 1
- 3
3
votes
1 answer
php-mode overwrites c-basic-offset customization, how can I set it to my preferred value?
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
PHP-Mode: https://github.com/emacs-php/php-mode, Version: 1.21.1
I customized c-basic-offset to 2.
When I open a php-File, php-mode is automatically invoked (by (add-to-list…

Andreas H
- 61
- 4
2
votes
1 answer
How to indent inline elements only once?
In this case the basic offset is 4 and tabs mode is enabled.
For example I am getting:
if (! (true // Problem when the value starts inline.
&& false)) {} // I get two tabs, one per '('.
if (! (
true // No problem when value does not…

mikl
- 413
- 3
- 19
2
votes
1 answer
Which variable modifies the switch statement indentation on php-mode?
I am currently using php-mode with spacemacs to write in php and recently I noticed this auto-indent behavior, namely pressing TAB.
switch ($cond) {
case "something":
break;
}
Auto indenting this region becomes
switch ($cond) {
case…

Rigotti
- 153
- 6
2
votes
2 answers
PHP no highlighting in org-mode code structure
How I can turn on highilighting php code in org-mode structure block?

slk500
- 461
- 2
- 14
2
votes
1 answer
PHP completion with Company does not work on local variables
I do have a strange issue when working on PHP files.
I have company-mode installed and it works for function completion but not for local variables.
For others languages such as Ruby or Lisp, everything is fine. But not for PHP.
In the following…

SmartyLisp
- 117
- 1
- 6
2
votes
1 answer
Migrate php-mode configuration to web-mode
I currently have my php-mode configuration like so:
(require 'php-mode)
(add-hook 'php-mode-hook
(lambda ()
(require 'ac-php-company)
(company-mode t)
(setq c-syntactic-indentation nil)
…

Damon Swayn
- 121
- 3
2
votes
1 answer
php-mode indents anonymous function incorrectly
I have the latest Emacs and php-mode setup and this code does not get indented correctly
$app->group('/route', function () use ($app) {
echo 'hello';
});
Instead it looks like this
$app->group('/route', function () use ($app) {
echo…

Oskar Persson
- 123
- 5
1
vote
1 answer
How do I stop emacs open certain files in conf-mode?
By default, my Emacs opens config.php in conf-mode. It looks like conf-mode uses a set of regular expressions to match the filename, but I can't figure out how to make it open in php-mode.
Any idea?

Rangi Lin
- 987
- 9
- 15
1
vote
1 answer
phpunit in org-mode src block
I'm using phpunit package
https://github.com/nlamirault/phpunit.el and it works great with php files.
But I have a simple php blog about refactoring ex: http://phprefactor.com/refactorings/decompose-conditional and I would like to run phpunit test…

slk500
- 461
- 2
- 14
1
vote
1 answer
Turn array from one-line into element-per-line
Say I have PHP array like this: $arr = ['one', 'two', 'three']; and I want to convert it to
$arr = [
'one',
'two',
'three'
];
real quick.
Is there any ready to use soluions?

neochar
- 13
- 4
1
vote
1 answer
In Geben, how can you jump to the currently paused line from any buffer
When debugging PHP with Geben and xdebug, how do you jump to the currently paused line (The line with a => mark in the margin) from any buffer.

tjb
- 197
- 1
- 7
1
vote
2 answers
How to indent relative to start of the previous line rather than relative to the beginning of the expression?
In php-mode – and in many others I believe – indentation of an expression spreading over several lines is computed relative to the starting column of the expression rather than the column of the first non-blank character of the line where the…

Michaël Le Barbier
- 61
- 6