summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <amin@gnu.org>2018-09-02 12:34:46 -0400
committerAmin Bandali <amin@gnu.org>2018-09-02 12:36:09 -0400
commit2090f4091f27ea6efc16176ebf0fadfdc2a33e0e (patch)
tree3e182ca3dc7077d8018fdcebe692c4581d6fcf03
parentd98421d58e0407f3a08259259f0dd9ab09163874 (diff)
downloadconfigs-2090f4091f27ea6efc16176ebf0fadfdc2a33e0e.tar.gz
configs-2090f4091f27ea6efc16176ebf0fadfdc2a33e0e.tar.xz
configs-2090f4091f27ea6efc16176ebf0fadfdc2a33e0e.zip
[emacs] defmacro setq-every! and set web-related indentation to 2
Diffstat (limited to '')
-rw-r--r--init.org34
1 files changed, 29 insertions, 5 deletions
diff --git a/init.org b/init.org
index 194a4b5..2173871 100644
--- a/init.org
+++ b/init.org
@@ -444,6 +444,15 @@ compilation."
`(after! (:all ,@features) ,@body)))))
#+end_src
+Convenience macro for =setq='ing multiple variables to the same value:
+
+#+begin_src emacs-lisp
+(defmacro setq-every! (value &rest vars)
+ "Set all the variables from VARS to value VALUE."
+ (declare (indent defun) (debug t))
+ `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
+#+end_src
+
* Core
:PROPERTIES:
:CUSTOM_ID: core
@@ -1168,22 +1177,37 @@ instead.
("C-c l l" . hs-lint)))
#+end_src
-** SGML and HTML
+** Web dev
+
+*** SGML and HTML
#+begin_src emacs-lisp
(use-package sgml-mode
:config
- (setq sgml-basic-offset 4))
+ (setq sgml-basic-offset 2))
#+end_src
-** Web mode
+*** CSS and SCSS
+
+#+begin_src emacs-lisp
+(use-package css-mode
+ :config
+ (setq css-indent-offset 2))
+#+end_src
+
+*** Web mode
#+begin_src emacs-lisp
(use-package web-mode
- :mode "\\.html\\'")
+ :mode "\\.html\\'"
+ :config
+ (setq-every! 2
+ web-mode-code-indent-offset
+ web-mode-css-indent-offset
+ web-mode-markup-indent-offset))
#+end_src
-** Emmet mode
+*** Emmet mode
#+begin_src emacs-lisp
(use-package emmet-mode