I use web-mode in Emacs to get syntax highlighting and padding for PHP and HTML.
If I have this code in a .php file
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
And then place the cursor in the middle row and click on the tab, after which nothing will happen.
I want it to look like this:
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
If I put the text in the tag on one line and try to back out, it works.
It:
<p> <a>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a> </p>
turns into this that should
<p> <a>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a> </p>
My .emacs file
(require 'web-mode) (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) (setq web-mode-markup-indent-offset 4) (setq web-mode-css-indent-offset 4) (setq web-mode-code-indent-offset 4) (setq web-mode-indent-style 4)

source share