mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-24 16:30:58 -05:00
Final update
This commit is contained in:
@@ -1,39 +1,42 @@
|
||||
(use-package flycheck
|
||||
:functions (flycheck-buffer)
|
||||
:commands (flycheck-mode flycheck-list-errors)
|
||||
:init
|
||||
(add-hooks '(ruby-mode-hook
|
||||
python-mode-hook
|
||||
php-mode-hook
|
||||
lua-mode-hook
|
||||
shell-mode-hook
|
||||
scss-mode-hook
|
||||
c++-mode-hook
|
||||
c-mode-hook)
|
||||
'flycheck-mode)
|
||||
(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))
|
||||
:config
|
||||
(progn ; flycheck settings
|
||||
(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))
|
||||
|
||||
(my--cleanup-buffers-add "^\\*Flycheck.*\\*$")
|
||||
(narf/add-throwaway-buffer "^\\*Flycheck.*\\*$")
|
||||
|
||||
(bind 'normal flycheck-error-list-mode-map
|
||||
(bind :normal :map flycheck-error-list-mode-map
|
||||
[escape] 'kill-this-buffer
|
||||
"q" 'kill-this-buffer)
|
||||
|
||||
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
||||
|
||||
(defun my--evil-flycheck-buffer ()
|
||||
(defun narf/evil-flycheck-buffer ()
|
||||
(if (and (featurep 'flycheck) flycheck-mode)
|
||||
(flycheck-buffer)))
|
||||
|
||||
;; Check buffer when normal mode is entered
|
||||
(add-hook 'evil-normal-state-entry-hook 'my--evil-flycheck-buffer)
|
||||
(add-hook 'evil-normal-state-entry-hook 'narf/evil-flycheck-buffer)
|
||||
;; And on ESC in normal mode.
|
||||
(defadvice evil-force-normal-state (after evil-esc-flycheck-buffer activate)
|
||||
(my--evil-flycheck-buffer))))
|
||||
(advice-add 'evil-force-normal-state :after 'narf/evil-flycheck-buffer)))
|
||||
|
||||
(use-package flyspell :commands flyspell-mode)
|
||||
|
||||
|
Reference in New Issue
Block a user