X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/957c8db6ad44f3f91163e5e65ebe66661bbe1cbc..2090f4091f27ea6efc16176ebf0fadfdc2a33e0e:/init.org?ds=inline diff --git a/init.org b/init.org index 5dacc59..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 @@ -1167,6 +1176,48 @@ instead. :bind (:map haskell-mode-map ("C-c l l" . hs-lint))) #+end_src + +** Web dev + +*** SGML and HTML + +#+begin_src emacs-lisp +(use-package sgml-mode + :config + (setq sgml-basic-offset 2)) +#+end_src + +*** 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\\'" + :config + (setq-every! 2 + web-mode-code-indent-offset + web-mode-css-indent-offset + web-mode-markup-indent-offset)) +#+end_src + +*** Emmet mode + +#+begin_src emacs-lisp +(use-package emmet-mode + :bind* (("C-)" . emmet-next-edit-point) + ("C-(" . emmet-prev-edit-point)) + :init + (setq emmet-move-cursor-between-quotes t) + :hook (web-mode css-mode html-mode sgml-mode)) +#+end_src + * Emacs Enhancements ** [[https://github.com/justbur/emacs-which-key][which-key]] @@ -1249,25 +1300,6 @@ Emacs package that displays available keybindings in popup :after #'my-projectile-invalidate-cache)))) #+end_src -** [[https://github.com/wasamasa/shackle][shackle]] - -#+begin_src emacs-lisp -(use-package shackle - :demand t - :commands shackle-mode - :config - (shackle-mode 1) - (setq shackle-rules - '(("*Help*" :align right :select t :size 0.5) - ("\\`\\*helm.*?\\*\\'" :regexp t :align t) - ((compilation-mode "\\`\\*magit-diff: .*?\\'") :regexp t :noselect t) - ("*magit-dispatch-popup*" :align below) - ((inferior-scheme-mode "*shell*" "*eshell*") :popup t)) - shackle-default-rule '(:select t) - shackle-default-size 0.4 - shackle-inhibit-window-quit-on-same-windows t)) -#+end_src - ** [[https://github.com/Wilfred/helpful][helpful]] #+begin_src emacs-lisp @@ -1285,8 +1317,6 @@ Emacs package that displays available keybindings in popup #+begin_src emacs-lisp (use-package shell-pop - :config - (add-to-list 'shackle-rules '("\\*eshell\\*" :regexp t :same t)) :custom (shell-pop-universal-key "C-c e") (shell-pop-shell-type '("eshell" "*eshell*" (lambda nil (eshell)))))