2017-06-08 11:47:56 +02:00
|
|
|
;;; feature/syntax-checker/config.el -*- lexical-binding: t; -*-
|
2017-02-13 05:51:36 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! flycheck
|
2018-05-25 00:46:11 +02:00
|
|
|
:commands (flycheck-list-errors flycheck-buffer)
|
2018-06-21 15:54:36 +02:00
|
|
|
:after-call (after-find-file doom-before-switch-buffer)
|
2017-02-13 05:51:36 -05:00
|
|
|
: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
|
|
|
|
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-06-21 15:54:36 +02:00
|
|
|
(add-hook 'evil-insert-state-exit-hook #'+syntax-checkers|flycheck-buffer))
|
|
|
|
|
|
|
|
(global-flycheck-mode +1))
|
2017-02-13 05:51:36 -05:00
|
|
|
|
|
|
|
|
2018-01-05 14:43:44 -05:00
|
|
|
(def-package! flycheck-popup-tip
|
2018-05-25 00:46:11 +02:00
|
|
|
:commands (flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup)
|
2018-06-05 03:21:26 +02:00
|
|
|
:init (add-hook 'flycheck-mode-hook #'+syntax-checker-popup-mode)
|
|
|
|
:config (setq flycheck-popup-tip-error-prefix "✕ "))
|
2018-05-07 18:50:44 +02:00
|
|
|
|
2018-01-05 14:43:44 -05:00
|
|
|
|
2018-05-07 18:50:44 +02:00
|
|
|
(def-package! flycheck-posframe
|
2018-05-25 00:46:11 +02:00
|
|
|
:when (and EMACS26+ (featurep! +childframe))
|
2018-05-09 11:26:06 +02:00
|
|
|
:commands flycheck-posframe-show-posframe
|
|
|
|
:config
|
|
|
|
(setq flycheck-posframe-warning-prefix "⚠ "
|
|
|
|
flycheck-posframe-info-prefix "··· "
|
|
|
|
flycheck-posframe-error-prefix "✕ "))
|