Created
October 22, 2013 04:18
-
-
Save v2e4lisp/7095170 to your computer and use it in GitHub Desktop.
php-mode setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun unindent-closure () | |
| (let ((syntax (mapcar 'car c-syntactic-context))) | |
| (if (and (member 'arglist-cont-nonempty syntax) | |
| (or | |
| (member 'statement-block-intro syntax) | |
| (member 'brace-list-intro syntax) | |
| (member 'brace-list-close syntax) | |
| (member 'block-close syntax))) | |
| (save-excursion | |
| (beginning-of-line) | |
| (delete-char (* (count 'arglist-cont-nonempty syntax) | |
| c-basic-offset)))))) | |
| (add-hook 'php-mode-hook (lambda () | |
| (add-hook 'c-special-indent-hook 'unindent-closure))) | |
| (defun wicked/php-mode-init () | |
| "Set some buffer-local variables." | |
| (c-set-style "linux") | |
| (setq indent-tabs-mode nil) | |
| (setq fill-column 78) | |
| (setq c-basic-offset 4) | |
| (c-set-offset 'arglist-cont 0) | |
| (c-set-offset 'arglist-intro '+) | |
| (c-set-offset 'case-label 2) | |
| (c-set-offset 'arglist-close 0)) | |
| (add-hook 'php-mode-hook 'wicked/php-mode-init) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment