Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
30 lines
1.1 KiB
EmacsLisp
30 lines
1.1 KiB
EmacsLisp
;;; feature/syntax-checker/config.el -*- lexical-binding: t; -*-
|
|
|
|
(def-package! flycheck
|
|
:commands (flycheck-list-errors flycheck-buffer)
|
|
:config
|
|
;; Emacs feels snappier without checks on newline
|
|
(setq flycheck-check-syntax-automatically '(save idle-change mode-enabled))
|
|
|
|
(after! evil
|
|
(defun +syntax-checkers|flycheck-buffer ()
|
|
"Flycheck buffer on ESC in normal mode."
|
|
(when flycheck-mode
|
|
(ignore-errors (flycheck-buffer))
|
|
nil))
|
|
(add-hook 'doom-escape-hook #'+syntax-checkers|flycheck-buffer t)
|
|
(add-hook 'evil-insert-state-exit-hook #'+syntax-checkers|flycheck-buffer)))
|
|
|
|
|
|
(def-package! flycheck-popup-tip
|
|
:commands (flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup)
|
|
:init (add-hook 'flycheck-mode-hook #'+syntax-checker-popup-mode))
|
|
|
|
|
|
(def-package! flycheck-posframe
|
|
:when (and EMACS26+ (featurep! +childframe))
|
|
:commands flycheck-posframe-show-posframe
|
|
:config
|
|
(setq flycheck-posframe-warning-prefix "⚠ "
|
|
flycheck-posframe-info-prefix "··· "
|
|
flycheck-posframe-error-prefix "✕ "))
|