2017-06-08 11:47:56 +02:00
|
|
|
;;; feature/syntax-checker/config.el -*- lexical-binding: t; -*-
|
2017-02-13 05:51:36 -05:00
|
|
|
|
2018-01-15 00:43:17 -05:00
|
|
|
;; Since Doom doesn't use `package-initialize', pkg-info won't get autoloaded
|
|
|
|
;; when `flycheck-version' needs it, so we need this:
|
2018-01-13 15:09:09 -05:00
|
|
|
(autoload 'pkg-info-version-info "pkg-info")
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! flycheck
|
2017-02-13 05:51:36 -05:00
|
|
|
:commands (flycheck-mode flycheck-list-errors flycheck-buffer)
|
|
|
|
:config
|
2018-01-06 01:10:33 -05:00
|
|
|
;; Emacs feels snappier without checks on newline
|
|
|
|
(setq flycheck-check-syntax-automatically '(save idle-change mode-enabled))
|
2017-02-13 05:51:36 -05:00
|
|
|
|
2018-05-07 18:50:44 +02:00
|
|
|
;; Popup
|
|
|
|
(add-hook 'flycheck-mode-hook #'+syntax-checker-popup-mode)
|
|
|
|
|
2017-04-17 02:17:10 -04:00
|
|
|
(after! evil
|
|
|
|
(defun +syntax-checkers|flycheck-buffer ()
|
2018-01-06 01:10:33 -05:00
|
|
|
"Flycheck buffer on ESC in normal mode."
|
2017-05-25 12:22:05 +02:00
|
|
|
(when flycheck-mode
|
|
|
|
(ignore-errors (flycheck-buffer))
|
|
|
|
nil))
|
2018-01-06 02:38:34 -05:00
|
|
|
(add-hook 'doom-escape-hook #'+syntax-checkers|flycheck-buffer t)
|
2018-04-21 06:17:55 -04:00
|
|
|
(add-hook 'evil-insert-state-exit-hook #'+syntax-checkers|flycheck-buffer)
|
2018-01-06 01:10:33 -05:00
|
|
|
|
2018-04-21 06:17:55 -04:00
|
|
|
;; With the option of flychecking the buffer on escape or leaving insert
|
|
|
|
;; mode, we don't need auto-flychecking on idle-change (which can feel slow,
|
|
|
|
;; esp on computers without SSDs).
|
2018-01-06 01:10:33 -05:00
|
|
|
(delq 'idle-change flycheck-check-syntax-automatically)))
|
2017-02-13 05:51:36 -05:00
|
|
|
|
|
|
|
|
2018-01-05 14:43:44 -05:00
|
|
|
(def-package! flycheck-popup-tip
|
2018-05-07 18:50:44 +02:00
|
|
|
:commands (flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup))
|
|
|
|
|
2018-01-05 14:43:44 -05:00
|
|
|
|
2018-05-07 18:50:44 +02:00
|
|
|
(def-package! flycheck-posframe
|
|
|
|
:when EMACS26+
|
2018-05-09 11:26:06 +02:00
|
|
|
:when (featurep! +childframe)
|
|
|
|
:commands flycheck-posframe-show-posframe
|
|
|
|
:config
|
|
|
|
(setq flycheck-posframe-warning-prefix "⚠ "
|
|
|
|
flycheck-posframe-info-prefix "··· "
|
|
|
|
flycheck-posframe-error-prefix "✕ "))
|