2019-02-22 00:20:29 -05:00
|
|
|
;;; tools/flycheck/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(defvar +flycheck-on-escape t
|
|
|
|
"If non-nil, flycheck will recheck the current buffer when pressing ESC/C-g.")
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Packages
|
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-08-31 14:10:25 +02:00
|
|
|
:after-call (doom-enter-buffer-hook after-find-file)
|
2017-02-13 05:51:36 -05:00
|
|
|
:config
|
2018-01-06 01:10:33 -05:00
|
|
|
;; Emacs feels snappier without checks on newline
|
2019-02-22 00:20:29 -05:00
|
|
|
(setq flycheck-check-syntax-automatically (delq 'new-line flycheck-check-syntax-automatically))
|
2017-02-13 05:51:36 -05:00
|
|
|
|
2019-02-22 00:20:29 -05:00
|
|
|
(defun +flycheck|buffer ()
|
|
|
|
"Flycheck buffer on ESC in normal mode."
|
|
|
|
(when (and flycheck-mode +flycheck-on-escape)
|
|
|
|
(ignore-errors (flycheck-buffer))
|
|
|
|
nil))
|
|
|
|
(add-hook 'doom-escape-hook #'+flycheck|buffer t)
|
2019-01-14 00:51:25 -05:00
|
|
|
|
2019-02-22 00:20:29 -05:00
|
|
|
(after! evil
|
2019-01-21 22:18:38 -05:00
|
|
|
(setq-hook! 'evil-insert-state-entry-hook
|
|
|
|
flycheck-idle-change-delay 1.75)
|
|
|
|
(setq-hook! 'evil-insert-state-exit-hook
|
|
|
|
flycheck-idle-change-delay (default-value 'flycheck-idle-change-delay)))
|
2018-06-21 15:54:36 +02:00
|
|
|
|
|
|
|
(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)
|
2019-02-28 05:01:04 -05:00
|
|
|
:init (add-hook 'flycheck-mode-hook #'+flycheck|init-popups)
|
|
|
|
: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))
|
2019-02-28 05:01:04 -05:00
|
|
|
:init (add-hook 'flycheck-mode-hook #'+flycheck|init-popups)
|
2018-05-09 11:26:06 +02:00
|
|
|
:config
|
|
|
|
(setq flycheck-posframe-warning-prefix "⚠ "
|
|
|
|
flycheck-posframe-info-prefix "··· "
|
|
|
|
flycheck-posframe-error-prefix "✕ "))
|