doomemacs/init/init-fly.el

46 lines
1.7 KiB
EmacsLisp
Raw Normal View History

2014-08-30 10:37:25 +08:00
(use-package flycheck
2015-06-05 06:23:21 +08:00
:functions (flycheck-buffer)
:commands (flycheck-mode flycheck-list-errors)
:init
2015-06-05 06:23:21 +08:00
(add-to-hooks 'flycheck-mode '(ruby-mode-hook
python-mode-hook
php-mode-hook
lua-mode-hook
shell-mode-hook
scss-mode-hook
c++-mode-hook
c-mode-hook))
2015-05-07 15:19:24 +08:00
:config
(progn ; flycheck settings
2015-06-05 06:23:21 +08:00
(defun my-shorter-fly-status (result)
(format "[%s]" (replace-regexp-in-string " FlyC:?" "" result)))
(advice-add 'flycheck-mode-line-status-text :filter-return 'my-shorter-fly-status)
(setq-default flycheck-indication-mode 'right-fringe
;; Removed checks on idle/change for snappiness
flycheck-check-syntax-automatically '(save mode-enabled idle-change)
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
2015-05-07 15:19:24 +08:00
2015-06-05 06:23:21 +08:00
(narf/add-throwaway-buffer "^\\*Flycheck.*\\*$")
2014-12-06 06:28:03 +08:00
2015-06-05 06:23:21 +08:00
(bind :normal :map flycheck-error-list-mode-map
2014-12-06 06:28:03 +08:00
[escape] 'kill-this-buffer
"q" 'kill-this-buffer)
(evil-initial-state 'flycheck-error-list-mode 'emacs)
2015-06-05 06:23:21 +08:00
(defun narf/evil-flycheck-buffer ()
2014-12-06 06:28:03 +08:00
(if (and (featurep 'flycheck) flycheck-mode)
(flycheck-buffer)))
;; Check buffer when normal mode is entered
2015-06-05 06:23:21 +08:00
(add-hook 'evil-normal-state-entry-hook 'narf/evil-flycheck-buffer)
2014-12-06 06:28:03 +08:00
;; And on ESC in normal mode.
2015-06-05 06:23:21 +08:00
(advice-add 'evil-force-normal-state :after 'narf/evil-flycheck-buffer)))
2014-08-08 06:35:22 +08:00
(use-package flyspell :commands flyspell-mode)
2014-12-13 04:35:58 +08:00
(provide 'init-fly)
;;; init-fly.el ends here