Simplify flycheck configuration with better error navigation functions
This commit is contained in:
parent
fc3e341bb9
commit
9a951de3b1
|
@ -871,12 +871,9 @@ determine the state to enable when escaping from the insert state.")
|
||||||
|
|
||||||
(defun spacemacs/init-flycheck ()
|
(defun spacemacs/init-flycheck ()
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:commands flycheck-mode
|
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
(evil-leader/set-key
|
|
||||||
"ef" 'flycheck-mode)
|
|
||||||
(dolist (mode '(c
|
(dolist (mode '(c
|
||||||
coffee
|
coffee
|
||||||
js
|
js
|
||||||
|
@ -965,15 +962,29 @@ determine the state to enable when escaping from the insert state.")
|
||||||
:fringe-bitmap 'my-flycheck-fringe-indicator
|
:fringe-bitmap 'my-flycheck-fringe-indicator
|
||||||
:fringe-face 'flycheck-fringe-info)
|
:fringe-face 'flycheck-fringe-info)
|
||||||
|
|
||||||
|
(defun spacemacs/next-error (&optional n reset)
|
||||||
|
"Dispatch to flycheck or standard emacs error."
|
||||||
|
(interactive "P")
|
||||||
|
(if (and (boundp 'flycheck-mode)
|
||||||
|
(symbol-value flycheck-mode))
|
||||||
|
(call-interactively 'flycheck-next-error)
|
||||||
|
(call-interactively 'next-error)))
|
||||||
|
|
||||||
|
(defun spacemacs/previous-error (&optional n reset)
|
||||||
|
"Dispatch to flycheck or standard emacs error."
|
||||||
|
(interactive "P")
|
||||||
|
(if (and (boundp 'flycheck-mode)
|
||||||
|
(symbol-value flycheck-mode))
|
||||||
|
(call-interactively 'flycheck-previous-error)
|
||||||
|
(call-interactively 'previous-error)))
|
||||||
|
|
||||||
;; key bindings
|
;; key bindings
|
||||||
(add-hook 'flycheck-mode-hook '(lambda ()
|
(evil-leader/set-key
|
||||||
(evil-leader/set-key
|
"ec" 'flycheck-clear
|
||||||
"ec" 'flycheck-clear
|
"ef" 'flycheck-mode
|
||||||
"el" 'flycheck-list-errors
|
"el" 'flycheck-list-errors
|
||||||
"en" 'flycheck-next-error
|
"en" 'spacemacs/next-error
|
||||||
"ep" 'flycheck-previous-error)
|
"eN" 'spacemacs/previous-error))))
|
||||||
))
|
|
||||||
)))
|
|
||||||
|
|
||||||
(defun spacemacs/init-flycheck-ledger ()
|
(defun spacemacs/init-flycheck-ledger ()
|
||||||
(eval-after-load 'flycheck
|
(eval-after-load 'flycheck
|
||||||
|
|
Loading…
Reference in a new issue