2014-09-05 17:08:40 -04:00
|
|
|
(provide 'init-fly)
|
|
|
|
|
2014-08-29 22:37:25 -04:00
|
|
|
(use-package flycheck
|
2014-12-05 17:28:03 -05:00
|
|
|
:defer t
|
|
|
|
:init (add-hook 'prog-mode-hook 'flycheck-mode)
|
|
|
|
:config
|
|
|
|
(progn ; flycheck settings
|
2014-10-09 18:37:37 -04:00
|
|
|
(setq-default flycheck-indication-mode 'right-fringe
|
|
|
|
;; Removed checks on idle/change for snappiness
|
2014-12-05 17:28:03 -05:00
|
|
|
flycheck-check-syntax-automatically '(save mode-enabled)
|
|
|
|
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
|
|
|
|
|
|
|
(my--cleanup-buffers-add "^\\*Flycheck.*\\*$")
|
|
|
|
|
|
|
|
(bind 'normal flycheck-error-list-mode-map
|
|
|
|
[escape] 'kill-this-buffer
|
|
|
|
"q" 'kill-this-buffer)
|
|
|
|
|
|
|
|
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
|
|
|
|
2014-12-07 15:03:48 -05:00
|
|
|
(evil-ex-define-cmd "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))
|
2014-12-05 17:28:03 -05:00
|
|
|
|
2014-12-07 15:03:48 -05:00
|
|
|
(defun my--evil-flycheck-buffer ()
|
2014-12-05 17:28:03 -05:00
|
|
|
(if (and (featurep 'flycheck) flycheck-mode)
|
|
|
|
(flycheck-buffer)))
|
|
|
|
|
|
|
|
;; Check buffer when normal mode is entered
|
2014-12-07 15:03:48 -05:00
|
|
|
(add-hook 'evil-normal-state-entry-hook 'my--evil-flycheck-buffer)
|
2014-12-05 17:28:03 -05:00
|
|
|
;; And on ESC in normal mode.
|
|
|
|
(defadvice evil-force-normal-state (after evil-esc-flycheck-buffer activate)
|
2014-12-07 15:03:48 -05:00
|
|
|
(my--evil-flycheck-buffer))
|
2014-12-05 17:28:03 -05:00
|
|
|
|
2014-12-07 15:03:48 -05:00
|
|
|
(push '("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t)
|
2014-12-05 17:28:03 -05:00
|
|
|
popwin:special-display-config)))
|
2014-08-07 18:35:22 -04:00
|
|
|
|
2014-11-29 20:21:03 -05:00
|
|
|
(use-package flyspell :commands flyspell-mode)
|