aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init
diff options
context:
space:
mode:
authorGravatar Tom Willemse2018-07-09 19:52:22 -0700
committerGravatar Tom Willemse2018-07-09 19:52:22 -0700
commitb12c7138893d7d75337549930a0bdd0ffc13b104 (patch)
treee88743a7d4f8b753d7c48da2d2c4917474e7dc7e /emacs/.emacs.d/init
parentc1f26123f7adf1680c78aa0cfdae68533687b61a (diff)
downloadnew-dotfiles-b12c7138893d7d75337549930a0bdd0ffc13b104.tar.gz
new-dotfiles-b12c7138893d7d75337549930a0bdd0ffc13b104.zip
Add extra PHP alignment rule
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r--emacs/.emacs.d/init/oni-align.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init/oni-align.el b/emacs/.emacs.d/init/oni-align.el
index 9e42e3f..3e45844 100644
--- a/emacs/.emacs.d/init/oni-align.el
+++ b/emacs/.emacs.d/init/oni-align.el
@@ -85,7 +85,23 @@
(add-to-list 'align-rules-list
`(php-array-arrow
- (regexp . ,(rx any (group whitespace) "=>" any))
+ (regexp . ,(rx any (group (zero-or-more whitespace)) "=>" any))
+ (group . (1))
+ (modes . '(php-mode web-mode))
+ (repeat . t)))
+
+;; The WordPress coding standards specify that multiple assignments
+;; should have their assignment operators aligned.
+
+;; <?php
+;; $variable = "value";
+;; $other_variable = "other value";
+;; $one_more_variable = "one more variable";
+
+(add-to-list align-rules-list
+ `(php-assignment-equals
+ (regexp . ,(rx any (group (zero-or-more whitespace)) "="
+ (zero-or-more whitespace) any))
(group . (1))
(modes . '(php-mode web-mode))
(repeat . t)))