diff options
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r-- | emacs/.emacs.d/init/oni-align.el | 62 | ||||
-rw-r--r-- | emacs/.emacs.d/init/oni-bookmark.el (renamed from emacs/.emacs.d/init/oni-bookmarks.el) | 0 |
2 files changed, 62 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/oni-align.el b/emacs/.emacs.d/init/oni-align.el index c42a5dd..9e42e3f 100644 --- a/emacs/.emacs.d/init/oni-align.el +++ b/emacs/.emacs.d/init/oni-align.el @@ -26,7 +26,69 @@ (require 'align) +;; Align CSS files like so: +;; body { color: #ffffff; } +;; .some-class { background-color: #ffffff; } +;; #some-id { width: 200px; } + +;; .some-more-class { +;; color: #ffffff; +;; background-color: #ffffff; +;; width: 200px; +;; } + +;; Keep these in order. They are each added to the _front_ of the +;; list and are applied in order. Changing their order will change +;; the results. +(add-to-list 'align-rules-list + `(css-closing-brace + (regexp . ,(rx (group (0+ whitespace)) "}" eol)) + (group . (1)) + (modes . '(scss-mode css-mode)))) + +(add-to-list 'align-rules-list + `(css-colons + (regexp . ,(rx bol + (0+ whitespace) + (1+ (any (?a . ?z) ?- ?$)) + ":" + (group (0+ whitespace)) + (0+ nonl) + ";" + eol)) + (group . (1)) + (modes . '(scss-mode css-mode)) + (repeat . t))) + +(add-to-list 'align-rules-list + `(css-opening-brace + (regexp . ,(rx bol + (0+ whitespace) + (0+ (any ?# ?. ?, ?\s ?& ?: ?- + (?a . ?z) (?A . ?Z) (?0 . ?9))) + (any (?a . ?z) (?A . ?Z) (?0 . ?9)) + (group (0+ whitespace)) + "{" + (0+ nonl))) + (group . (1)) + (modes . '(scss-mode css-mode)))) + +;; In PHP code it's nice to have any ~=>~ aligned. + +;; <?php +;; array( +;; 'foo' => 'bar', +;; 'frob' => 'baz' +;; ); +;; ?> + +(add-to-list 'align-rules-list + `(php-array-arrow + (regexp . ,(rx any (group whitespace) "=>" any)) + (group . (1)) + (modes . '(php-mode web-mode)) + (repeat . t))) (provide 'oni-align) ;;; oni-align.el ends here diff --git a/emacs/.emacs.d/init/oni-bookmarks.el b/emacs/.emacs.d/init/oni-bookmark.el index 2b7d637..2b7d637 100644 --- a/emacs/.emacs.d/init/oni-bookmarks.el +++ b/emacs/.emacs.d/init/oni-bookmark.el |