💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass the :local or :append properties to it. This is how they used to work: (add-hook! :append 'some-mode-hook #'do-something) Thsoe properties must now follow the hooks, e.g. (add-hook! 'some-mode-hook :append #'do-something) Other changes: - Various add-hook calls have been renamed to add-hook! because I incorrectly assumed `defun` always returned its definition's symbol, when in fact, its return value is "undefined" (so sayeth the documentation). This should fix #1597. - This update adds the ability to add multiple functions to hooks without a list: (add-hook! 'some-mode-hook #'do-something #'do-something-else) - The indentation logic has been changed so that consecutive function symbols at indented at the same level as the first argument, but forms are indent like a defun. (add-hook! 'some-mode-hook #'do-something #'do-something-else) (add-hook! 'some-mode-hook (message "Hello"))
This commit is contained in:
parent
c2ae6f30a5
commit
a3e262c7ac
42 changed files with 248 additions and 225 deletions
|
@ -169,7 +169,7 @@ compilation dbs."
|
|||
;; collect (format "-I%s" path))])))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc|init-ffap-integration ()
|
||||
(defun +cc-init-ffap-integration-h ()
|
||||
"Takes the local project include paths and registers them with ffap.
|
||||
This way, `find-file-at-point' (and `+lookup/file') will know where to find most
|
||||
header files."
|
||||
|
|
|
@ -50,8 +50,10 @@ This is ignored by ccls.")
|
|||
|
||||
;; Ensure find-file-at-point works in C modes, must be added before irony
|
||||
;; and/or lsp hooks are run.
|
||||
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
||||
#'+cc|init-ffap-integration)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
#'+cc-init-ffap-integration-h)
|
||||
|
||||
:config
|
||||
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
||||
|
@ -80,7 +82,7 @@ This is ignored by ccls.")
|
|||
|
||||
;;; Better fontification (also see `modern-cpp-font-lock')
|
||||
(add-hook 'c-mode-common-hook #'rainbow-delimiters-mode)
|
||||
(add-hook! (c-mode c++-mode) #'+cc-fontify-constants-h)
|
||||
(add-hook! '(c-mode-hook c++-mode-hook) #'+cc-fontify-constants-h)
|
||||
|
||||
;; Custom style, based off of linux
|
||||
(c-add-style
|
||||
|
@ -125,7 +127,9 @@ This is ignored by ccls.")
|
|||
:preface
|
||||
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||
:init
|
||||
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
(defun +cc-init-irony-mode-h ()
|
||||
(if (file-directory-p irony-server-install-prefix)
|
||||
(irony-mode +1)
|
||||
|
@ -181,7 +185,9 @@ This is ignored by ccls.")
|
|||
:preface
|
||||
(setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||
:init
|
||||
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
(defun +cc-init-rtags-h ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers."
|
||||
(when (and (require 'rtags nil t)
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
(setq omnisharp-auto-complete-want-documentation nil
|
||||
omnisharp-cache-directory (concat doom-cache-dir "omnisharp"))
|
||||
:config
|
||||
(defun +csharp|cleanup-omnisharp-server ()
|
||||
(defun +csharp-cleanup-omnisharp-server-h ()
|
||||
"Clean up the omnisharp server once you kill the last csharp-mode buffer."
|
||||
(unless (doom-buffers-in-mode 'csharp-mode (buffer-list))
|
||||
(omnisharp-stop-server)))
|
||||
(add-hook! csharp-mode
|
||||
(add-hook 'kill-buffer-hook #'+csharp|cleanup-omnisharp-server nil t))
|
||||
(add-hook! 'csharp-mode-hook
|
||||
(add-hook 'kill-buffer-hook #'+csharp-cleanup-omnisharp-server-h nil t))
|
||||
|
||||
(set-company-backend! 'csharp-mode 'company-omnisharp)
|
||||
(set-lookup-handlers! 'csharp-mode
|
||||
|
|
|
@ -47,24 +47,16 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
|||
;; variable-width indentation is superior in elisp
|
||||
(add-to-list 'doom-detect-indentation-excluded-modes 'emacs-lisp-mode nil #'eq)
|
||||
|
||||
;; Special indentation behavior for `add-hook'; indent like a defun block if
|
||||
;; it contains `defun' forms and like normal otherwise.
|
||||
(defun +emacs-lisp-indent-add-hook-fn (indent-point state)
|
||||
(goto-char indent-point)
|
||||
(when (looking-at-p "\\s-*(defun ")
|
||||
(lisp-indent-defform state indent-point)))
|
||||
(put 'add-hook 'lisp-indent-function #'+emacs-lisp-indent-add-hook-fn)
|
||||
|
||||
;; Use helpful instead of describe-* from `company'
|
||||
(advice-add #'elisp--company-doc-buffer :around #'doom-use-helpful-a)
|
||||
|
||||
(add-hook! 'emacs-lisp-mode-hook
|
||||
#'(outline-minor-mode
|
||||
;; fontificiation
|
||||
rainbow-delimiters-mode
|
||||
highlight-quoted-mode
|
||||
;; initialization
|
||||
+emacs-lisp-extend-imenu-h))
|
||||
#'outline-minor-mode
|
||||
;; fontificiation
|
||||
#'rainbow-delimiters-mode
|
||||
#'highlight-quoted-mode
|
||||
;; initialization
|
||||
#'+emacs-lisp-extend-imenu-h)
|
||||
|
||||
;; Flycheck's two emacs-lisp checkers produce a *lot* of false positives in
|
||||
;; emacs configs, so we disable `emacs-lisp-checkdoc' and reduce the
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#'+haskell/open-repl)
|
||||
|
||||
(add-hook! 'haskell-mode-hook
|
||||
#'(haskell-collapse-mode ; support folding haskell code blocks
|
||||
interactive-haskell-mode))
|
||||
#'haskell-collapse-mode ; support folding haskell code blocks
|
||||
#'interactive-haskell-mode)
|
||||
|
||||
(add-to-list 'completion-ignored-extensions ".hi")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; lang/idris/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! idris-mode
|
||||
(add-hook! 'idris-mode-hook 'turn-on-idris-simple-indent)
|
||||
(add-hook 'idris-mode-hook #'turn-on-idris-simple-indent)
|
||||
(set-repl-handler! 'idris-mode 'idris-pop-to-repl)
|
||||
(set-lookup-handlers! 'idris-mode
|
||||
:documentation #'idris-docs-at-point
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
(buffer-substring-no-properties beg end))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +java|android-mode-maybe ()
|
||||
(defun +java-android-mode-maybe-h ()
|
||||
"Enable `android-mode' if this looks like an android project.
|
||||
|
||||
It determines this by the existence of AndroidManifest.xml or
|
||||
|
|
|
@ -33,7 +33,8 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
|
|||
(use-package! android-mode
|
||||
:commands android-mode
|
||||
:init
|
||||
(add-hook! (java-mode groovy-mode nxml-mode) #'+java|android-mode-maybe)
|
||||
(add-hook! '(java-mode-hook groovy-mode-hook nxml-mode-hook)
|
||||
#'+java-android-mode-maybe-h)
|
||||
:config
|
||||
(set-yas-minor-mode! 'android-mode))
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ Run this for any buffer you want to skewer."
|
|||
;; Hooks
|
||||
|
||||
;;;###autoload
|
||||
(defun +javascript|add-node-modules-path ()
|
||||
(defun +javascript-add-node-modules-path-h ()
|
||||
"Add current project's `node_modules/.bin` to `exec-path', so js tools
|
||||
prioritize project-local packages over global ones."
|
||||
(make-local-variable 'exec-path)
|
||||
|
@ -96,7 +96,7 @@ prioritize project-local packages over global ones."
|
|||
exec-path :test #'string=))
|
||||
|
||||
;;;###autoload
|
||||
(defun +javascript|cleanup-tide-processes ()
|
||||
(defun +javascript-cleanup-tide-processes-h ()
|
||||
"Clean up dangling tsserver processes if there are no more buffers with
|
||||
`tide-mode' active that belong to that server's project."
|
||||
(when tide-mode
|
||||
|
@ -113,7 +113,7 @@ prioritize project-local packages over global ones."
|
|||
;; Advice
|
||||
|
||||
;;;###autoload
|
||||
(defun +javascript*tide-project-root ()
|
||||
(defun +javascript-tide-project-root-a ()
|
||||
"Resolve to `doom-project-root' if `tide-project-root' fails."
|
||||
(or tide-project-root
|
||||
(or (locate-dominating-file default-directory "tsconfig.json")
|
||||
|
|
|
@ -87,10 +87,10 @@
|
|||
;; a self-closing tag, so that it can insert a matching ending tag at point.
|
||||
;; However, the parser doesn't run immediately, so a fast typist can outrun
|
||||
;; it, causing tags to stay unclosed, so we force it to parse.
|
||||
(defun +javascript|reparse (n)
|
||||
(defadvice! +javascript-reparse-a (n)
|
||||
;; if n != 1, rjsx-electric-gt calls rjsx-maybe-reparse itself
|
||||
(if (= n 1) (rjsx-maybe-reparse)))
|
||||
(advice-add #'rjsx-electric-gt :before #'+javascript|reparse))
|
||||
:before #'rjsx-electric-gt
|
||||
(if (= n 1) (rjsx-maybe-reparse))))
|
||||
|
||||
|
||||
(after! typescript-mode
|
||||
|
@ -127,33 +127,32 @@
|
|||
;;
|
||||
;;; Tools
|
||||
|
||||
(defun +javascript|init-lsp-or-tide-maybe ()
|
||||
"Start `lsp' or `tide' in the current buffer.
|
||||
(add-hook! '(js-mode-hook typescript-mode-hook web-mode-hook)
|
||||
(defun +javascript-init-lsp-or-tide-maybe-h ()
|
||||
"Start `lsp' or `tide' in the current buffer.
|
||||
|
||||
LSP will be used if the +lsp flag is enabled for :lang javascript AND if the
|
||||
current buffer represents a file in a project.
|
||||
|
||||
If LSP fails to start (e.g. no available server or project), then we fall back
|
||||
to tide."
|
||||
(let ((buffer-file-name (buffer-file-name (buffer-base-buffer))))
|
||||
(when (or (derived-mode-p 'js-mode 'typescript-mode)
|
||||
(and (eq major-mode 'web-mode)
|
||||
(string= "tsx" (file-name-extension buffer-file-name))))
|
||||
(if (not buffer-file-name)
|
||||
;; necessary because `tide-setup' and `lsp' will error if not a
|
||||
;; file-visiting buffer
|
||||
(add-hook 'after-save-hook #'+javascript|init-tide-or-lsp-maybe nil 'local)
|
||||
(or (and (featurep! +lsp)
|
||||
(progn (lsp!) lsp-mode))
|
||||
;; fall back to tide
|
||||
(if (executable-find "node")
|
||||
(and (require 'tide nil t)
|
||||
(progn (tide-setup) tide-mode))
|
||||
(ignore
|
||||
(doom-log "Couldn't start tide because 'node' is missing"))))
|
||||
(remove-hook 'after-save-hook #'+javascript|init-tide-or-lsp-maybe 'local)))))
|
||||
|
||||
(add-hook! (js-mode typescript-mode web-mode) #'+javascript|init-lsp-or-tide-maybe)
|
||||
(let ((buffer-file-name (buffer-file-name (buffer-base-buffer))))
|
||||
(when (or (derived-mode-p 'js-mode 'typescript-mode)
|
||||
(and (eq major-mode 'web-mode)
|
||||
(string= "tsx" (file-name-extension buffer-file-name))))
|
||||
(if (not buffer-file-name)
|
||||
;; necessary because `tide-setup' and `lsp' will error if not a
|
||||
;; file-visiting buffer
|
||||
(add-hook 'after-save-hook #'+javascript-init-tide-or-lsp-maybe-h nil 'local)
|
||||
(or (and (featurep! +lsp)
|
||||
(progn (lsp!) lsp-mode))
|
||||
;; fall back to tide
|
||||
(if (executable-find "node")
|
||||
(and (require 'tide nil t)
|
||||
(progn (tide-setup) tide-mode))
|
||||
(ignore
|
||||
(doom-log "Couldn't start tide because 'node' is missing"))))
|
||||
(remove-hook 'after-save-hook #'+javascript-init-tide-or-lsp-maybe-h 'local))))))
|
||||
|
||||
|
||||
(use-package! tide
|
||||
|
@ -172,10 +171,10 @@ to tide."
|
|||
:definition '(tide-jump-to-definition :async t)
|
||||
:references '(tide-references :async t))
|
||||
;; resolve to `doom-project-root' if `tide-project-root' fails
|
||||
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
|
||||
(advice-add #'tide-project-root :override #'+javascript-tide-project-root-a)
|
||||
;; cleanup tsserver when no tide buffers are left
|
||||
(add-hook! 'tide-mode-hook
|
||||
(add-hook 'kill-buffer-hook #'+javascript|cleanup-tide-processes nil t))
|
||||
(add-hook 'kill-buffer-hook #'+javascript-cleanup-tide-processes-h nil t))
|
||||
|
||||
(define-key tide-mode-map [remap +lookup/documentation] #'tide-documentation-at-point)
|
||||
|
||||
|
@ -206,9 +205,8 @@ to tide."
|
|||
(use-package! eslintd-fix
|
||||
:commands eslintd-fix
|
||||
:config
|
||||
(defun +javascript|set-flycheck-executable-to-eslint ()
|
||||
(setq flycheck-javascript-eslint-executable eslintd-fix-executable))
|
||||
(add-hook 'eslintd-fix-mode-hook #'+javascript|set-flycheck-executable-to-eslint))
|
||||
(setq-hook! 'eslintd-fix-mode-hook
|
||||
flycheck-javascript-eslint-executable eslintd-fix-executable))
|
||||
|
||||
|
||||
;;;###package skewer-mode
|
||||
|
@ -253,7 +251,7 @@ to tide."
|
|||
(def-project-mode! +javascript-npm-mode
|
||||
:modes '(html-mode css-mode web-mode typescript-mode js2-mode rjsx-mode json-mode markdown-mode)
|
||||
:when (locate-dominating-file default-directory "package.json")
|
||||
:add-hooks '(+javascript|add-node-modules-path npm-mode))
|
||||
:add-hooks '(+javascript-add-node-modules-path-h npm-mode))
|
||||
|
||||
(def-project-mode! +javascript-gulp-mode
|
||||
:when (locate-dominating-file default-directory "gulpfile.js"))
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
(setq-hook! 'moonscript-mode-hook
|
||||
moonscript-indent-offset tab-width)
|
||||
(add-hook! 'moonscript-mode-hook
|
||||
#'(+lua|moonscript-fix-single-quotes
|
||||
+lua|moonscript-fontify-interpolation)))
|
||||
#'+lua|moonscript-fix-single-quotes
|
||||
#'+lua|moonscript-fontify-interpolation))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;;; lang/ocaml/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! (tuareg-mode-local-vars reason-mode-local-vars)
|
||||
#'lsp!))
|
||||
(add-hook! '(tuareg-mode-local-vars-hook reason-mode-local-vars-hook)
|
||||
#'lsp!))
|
||||
|
||||
|
||||
(after! tuareg
|
||||
|
|
|
@ -491,8 +491,12 @@ between the two."
|
|||
;; insert new headings after current subtree rather than inside it
|
||||
org-insert-heading-respect-content t)
|
||||
|
||||
(add-hook! 'org-tab-first-hook #'(+org-indent-maybe-h +org-yas-expand-maybe-h))
|
||||
(add-hook 'doom-delete-backward-functions #'+org-delete-backward-char-and-realign-table-maybe-h)
|
||||
(add-hook! 'org-tab-first-hook
|
||||
#'+org-indent-maybe-h
|
||||
#'+org-yas-expand-maybe-h)
|
||||
|
||||
(add-hook 'doom-delete-backward-functions
|
||||
#'+org-delete-backward-char-and-realign-table-maybe-h)
|
||||
|
||||
(map! :map org-mode-map
|
||||
;; textmate-esque newline insertion
|
||||
|
@ -803,39 +807,39 @@ compelling reason, so..."
|
|||
))
|
||||
|
||||
(add-hook! 'org-mode-hook
|
||||
#'(org-bullets-mode ; "prettier" bullets
|
||||
org-indent-mode ; margin-based indentation
|
||||
toc-org-enable ; auto-table of contents
|
||||
auto-fill-mode ; hard line wrapping
|
||||
;; `show-paren-mode' causes flickering with indentation margins made by
|
||||
;; `org-indent-mode', so we turn off show-paren-mode altogether
|
||||
doom-disable-show-paren-mode-h
|
||||
;; Shows a lot of false positives, so...
|
||||
doom-disable-show-trailing-whitespace-h
|
||||
#'org-bullets-mode ; "prettier" bullets
|
||||
#'org-indent-mode ; margin-based indentation
|
||||
#'toc-org-enable ; auto-table of contents
|
||||
#'auto-fill-mode ; hard line wrapping
|
||||
;; `show-paren-mode' causes flickering with indentation margins made by
|
||||
;; `org-indent-mode', so we turn off show-paren-mode altogether
|
||||
#'doom-disable-show-paren-mode-h
|
||||
;; Shows a lot of false positives, so...
|
||||
#'doom-disable-show-trailing-whitespace-h
|
||||
|
||||
+org-enable-auto-reformat-tables-h
|
||||
+org-enable-auto-update-cookies-h
|
||||
+org-unfold-to-2nd-level-or-point-h))
|
||||
#'+org-enable-auto-reformat-tables-h
|
||||
#'+org-enable-auto-update-cookies-h
|
||||
#'+org-unfold-to-2nd-level-or-point-h)
|
||||
|
||||
(add-hook! 'org-load-hook
|
||||
#'(+org-init-appearance-h
|
||||
+org-init-agenda-h
|
||||
+org-init-babel-h
|
||||
+org-init-babel-lazy-loader-h
|
||||
+org-init-capture-defaults-h
|
||||
+org-init-capture-frame-h
|
||||
+org-init-centralized-attachments-h
|
||||
+org-init-centralized-exports-h
|
||||
+org-init-custom-links-h
|
||||
+org-init-export-h
|
||||
+org-init-habit-h
|
||||
+org-init-hacks-h
|
||||
+org-init-keybinds-h
|
||||
+org-init-keybinds-for-evil-h ; will noop without :editor evil
|
||||
+org-init-popup-rules-h
|
||||
+org-init-protocol-h
|
||||
+org-init-protocol-lazy-loader-h
|
||||
+org-init-smartparens-h))
|
||||
#'+org-init-appearance-h
|
||||
#'+org-init-agenda-h
|
||||
#'+org-init-babel-h
|
||||
#'+org-init-babel-lazy-loader-h
|
||||
#'+org-init-capture-defaults-h
|
||||
#'+org-init-capture-frame-h
|
||||
#'+org-init-centralized-attachments-h
|
||||
#'+org-init-centralized-exports-h
|
||||
#'+org-init-custom-links-h
|
||||
#'+org-init-export-h
|
||||
#'+org-init-habit-h
|
||||
#'+org-init-hacks-h
|
||||
#'+org-init-keybinds-h
|
||||
#'+org-init-keybinds-for-evil-h ; will noop without :editor evil
|
||||
#'+org-init-popup-rules-h
|
||||
#'+org-init-protocol-h
|
||||
#'+org-init-protocol-lazy-loader-h
|
||||
#'+org-init-smartparens-h)
|
||||
|
||||
;; In case the user has eagerly loaded org from their configs
|
||||
(when (featurep 'org)
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
:n [left] #'org-tree-slide-move-previous-tree)
|
||||
|
||||
(add-hook! 'org-tree-slide-mode-after-narrow-hook
|
||||
#'(+org-present-detect-slide-h
|
||||
+org-present-add-overlays-h
|
||||
org-display-inline-images))
|
||||
#'+org-present-detect-slide-h
|
||||
#'+org-present-add-overlays-h
|
||||
#'org-display-inline-images)
|
||||
|
||||
(add-hook 'org-tree-slide-mode-hook #'+org-present-init-org-tree-window-h)
|
||||
(advice-add #'org-tree-slide--display-tree-with-narrow
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
(after! purescript-mode
|
||||
(add-hook! 'purescript-mode-hook
|
||||
#'(purescript-indentation-mode
|
||||
rainbow-delimiters-mode))
|
||||
#'purescript-indentation-mode
|
||||
#'rainbow-delimiters-mode)
|
||||
(set-lookup-handlers! 'purescript-mode
|
||||
:definition #'psc-ide-goto-definition
|
||||
:documentation #'purescript-pursuit))
|
||||
|
|
|
@ -84,7 +84,7 @@ called.")
|
|||
|
||||
|
||||
(use-package! anaconda-mode
|
||||
:hook (python-mode-local-vars . +python|init-anaconda-mode-maybe)
|
||||
:hook (python-mode-local-vars . +python-init-anaconda-mode-maybe-h)
|
||||
:init
|
||||
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
|
||||
anaconda-mode-eldoc-as-single-line t)
|
||||
|
@ -97,18 +97,18 @@ called.")
|
|||
:documentation #'anaconda-mode-show-doc)
|
||||
(set-popup-rule! "^\\*anaconda-mode" :select nil)
|
||||
|
||||
(defun +python|init-anaconda-mode-maybe ()
|
||||
(defun +python-init-anaconda-mode-maybe-h ()
|
||||
(unless (bound-and-true-p lsp-mode)
|
||||
(anaconda-mode +1)))
|
||||
|
||||
(defun +python|auto-kill-anaconda-processes ()
|
||||
(defun +python-auto-kill-anaconda-processes-h ()
|
||||
"Kill anaconda processes if this buffer is the last python buffer."
|
||||
(when (and (eq major-mode 'python-mode)
|
||||
(not (delq (current-buffer)
|
||||
(doom-buffers-in-mode 'python-mode (buffer-list)))))
|
||||
(anaconda-mode-stop)))
|
||||
(add-hook! 'python-mode-hook
|
||||
(add-hook 'kill-buffer-hook #'+python|auto-kill-anaconda-processes nil t))
|
||||
(add-hook 'kill-buffer-hook #'+python-auto-kill-anaconda-processes-h nil t))
|
||||
|
||||
(when (featurep 'evil)
|
||||
(add-hook 'anaconda-mode-hook #'evil-normalize-keymaps))
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
(setq racket-smart-open-bracket-enable t)
|
||||
|
||||
(add-hook! racket-mode #'(rainbow-delimiters-mode highlight-quoted-mode))
|
||||
(add-hook! 'racket-mode-hook
|
||||
#'rainbow-delimiters-mode
|
||||
#'highlight-quoted-mode)
|
||||
|
||||
(map! :localleader
|
||||
:map racket-mode-map
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
;;
|
||||
;;; Major modes
|
||||
|
||||
(add-hook! (css-mode sass-mode stylus-mode) #'rainbow-mode)
|
||||
(add-hook! '(css-mode-hook sass-mode-hook stylus-mode-hook)
|
||||
#'rainbow-mode)
|
||||
|
||||
;; built-in, and contains both css-mode & scss-mode
|
||||
(after! css-mode
|
||||
|
@ -47,7 +48,8 @@
|
|||
;;; Tools
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! (css-mode sass-mode less-css-mode) #'lsp!))
|
||||
(add-hook! '(css-mode-hook sass-mode-hook less-css-mode-hook)
|
||||
#'lsp!))
|
||||
|
||||
|
||||
(use-package! counsel-css
|
||||
|
|
|
@ -142,4 +142,4 @@
|
|||
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! (html-mode web-mode) #'lsp!))
|
||||
(add-hook! '(html-mode-hook web-mode-hook) #'lsp!))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue