Move more from org-mode
This commit is contained in:
parent
f6bd936f91
commit
61496a0b81
3 changed files with 65 additions and 1 deletions
|
@ -145,7 +145,9 @@
|
|||
|
||||
;;;; Lazy configurations:
|
||||
|
||||
(with-eval-after-load 'bookmark (load "init/oni-bookmarks"))
|
||||
(with-eval-after-load 'bookmark (load "init/oni-bookmark"))
|
||||
(with-eval-after-load 'align (load "init/oni-align"))
|
||||
(with-eval-after-load 'browse-url (load "init/oni-browse-url"))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue