Skip to main content
3 votes
Accepted

PHP completion with Company does not work on local variables

You only need php-extras-company and company-dabbrev, place them in the same group and at the BEGINNING of the company-backends, (add-hook 'php-mode-hook (lambda () (set (...
chen bin's user avatar
  • 4,877
3 votes

php-mode overwrites c-basic-offset customization, how can I set it to my preferred value?

This code in .emacs did the job: (add-hook 'php-mode-hook (lambda () (make-local-variable 'c-basic-offset) (setq c-basic-offset 2))) I failed previously because I tried to ...
Andreas H's user avatar
3 votes

How to use phpactor.el in GNU Emacs 25.2.2

Here is my code. Yes the documentation is awful for phpactor and it takes some digging. I have this currently and it shows how to use transients and bind them to a key in php-mode. Hopefully useful to ...
RichieHH's user avatar
  • 873
2 votes

PHP no highlighting in org-mode code structure

ob-php is now in Org mode contrib and available through the org-plus-contrib package in Org ELPA. You can install this package by adding Org ELPA to your package-archives list in your init file: (...
Chris Charabaruk's user avatar
1 vote

company-mode: static sources overwrites LSP

add-to-list is a function that insert the new element at the beginning of the list (unless the append argument is used). Thus the new element takes priority and is used exclusively. I suggest you use ...
Dmitry's user avatar
  • 3,803
1 vote

How to disable syntactic indentation interactively in php-mode?

Just guessing here because I can't replicate the issue, but do the following slightly different functions work? (defun my/indent-region-left-tab () (interactive) (let ((c-syntactic-indentation ...
scolej's user avatar
  • 76
1 vote
Accepted

How to indent inline elements only once?

If the lineup function my-php-lineup-arglist-cont below is registered for the indentation of arglist-cont it fetches the indentation of the preceeding function statement and adds one times c-basic-...
Tobias's user avatar
  • 33.3k
1 vote
Accepted

How to indent php delimiter in php-mode?

This worked for me: (defun my-php-indent-setup () (c-set-offset 'topmost-intro '+) ; Does not affect <?php (but affects ?>) (c-set-offset 'inclass 0)) ; Gets the inside of class{} ...
mikl's user avatar
  • 433
1 vote
Accepted

How to indent with tabs in php-mode?

Ok I was leaning how php-mode handles indentation, and also I looked into php-mode.el: The problem was that (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style) sets: (setq indent-tabs-mode ...
mikl's user avatar
  • 433
1 vote
Accepted

How to use phpactor.el in GNU Emacs 25.2.2

I followed the @nega's advice and I've submitted a Github issue. In short, the part in my ~/.emacs was problematic, I had to delete it. I mean this part: (add-hook 'php-mode-hook (...
Anthony's user avatar
  • 111
1 vote
Accepted

Which variable modifies the switch statement indentation on php-mode?

You can customize the indent level of the switch case for PHP like this: (c-set-offset 'case-label 4) This should work for any language that's based on the c-mode.
Jesse's user avatar
  • 1,994
1 vote
Accepted

phpunit in org-mode src block

Finally I make it work. The main problem is that org-mode shell source blocks do not capture stderr. You can read more about this here. So normally you will not see output if one of the test fails. ...
slk500's user avatar
  • 473
1 vote
Accepted

Turn array from one-line into element-per-line

Don't know about PHP. You can try to search for PHP code formatters and see if it has such function. Here is a simple solution using regular expression. It works for your particular example at least. ...
xuchunyang's user avatar
  • 14.6k
1 vote
Accepted

PHP no highlighting in org-mode code structure

With the current versions of php-mode and org-mode, PHP syntax highlighting in org code blocks happens by default. The version of org-mode in Emacs 26.1 includes this support. For earlier versions ...
slk500's user avatar
  • 473
1 vote
Accepted

In Geben, how can you jump to the currently paused line from any buffer

w calls geben-where: geben-where is an interactive compiled Lisp function in `geben.el'. (geben-where) Move to the current breaking point. It is also bound to C-cC-l which, from the comments, may ...
phils's user avatar
  • 51.6k
1 vote
Accepted

How to indent PHP code in PHP-mode?

This problem is solved. Thanks to Phil Newton (sodaware) for creating this extension to integrate with PHP_beautifier. This application was released 5 hours ago (on March 28, 2017). I have tried ...
azzamsa's user avatar
  • 634
1 vote

How to indent relative to start of the previous line rather than relative to the beginning of the expression?

Following the steps in this answer over at Stack Overflow I was able to fix this by tweaking the underlying c-mode like so: (defun my-php-mode-hook () (c-set-offset 'arglist-cont-nonempty '+)) (...
dustym's user avatar
  • 11
1 vote

How to indent relative to start of the previous line rather than relative to the beginning of the expression?

Maybe the solution in the section Indentation of arrays of the emacs wiki php-mode page, or a variation of it, is what you are searching for. Quotation: (add-hook 'php-mode-hook (lambda () (defun ...
Vera Johanna's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible