aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d
diff options
context:
space:
mode:
authorGravatar Tom Willemse2018-05-29 01:02:11 -0700
committerGravatar Tom Willemse2018-05-29 01:02:11 -0700
commit61496a0b817e54d6b67e0ac09ab0fb1611bad9f3 (patch)
treeeafc524f4976115a431acd1c75961f13573f89e7 /emacs/.emacs.d
parentf6bd936f91fccd51a1160f9fc012b23ab52c73b9 (diff)
downloadnew-dotfiles-61496a0b817e54d6b67e0ac09ab0fb1611bad9f3.tar.gz
new-dotfiles-61496a0b817e54d6b67e0ac09ab0fb1611bad9f3.zip
Move more from org-mode
Diffstat (limited to 'emacs/.emacs.d')
-rw-r--r--emacs/.emacs.d/init.el4
-rw-r--r--emacs/.emacs.d/init/oni-align.el62
-rw-r--r--emacs/.emacs.d/init/oni-bookmark.el (renamed from emacs/.emacs.d/init/oni-bookmarks.el)0
3 files changed, 65 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index 058e86e..5fa6186 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -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
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