Flycheck Syntax Checking

about | blog | config | notes | github

A package for GNU/Emacs that enables syntax checking for many different languages.

1. Configuration

1.1. Package Setup

(use-package flycheck
  :diminish
  :commands flycheck-redefine-standard-error-levels
  :hook (after-init . global-flycheck-mode)
  :init (setq flycheck-global-modes
              '(not text-mode outline-mode fundamental-mode lisp-interaction-mode
                    org-mode diff-mode shell-mode eshell-mode term-mode vterm-mode)
              flycheck-emacs-lisp-load-path 'inherit
              flycheck-indication-mode (if (display-graphic-p)
                                           'right-fringe
                                         'right-margin)
              ;; Only check while saving and opening files
              flycheck-check-syntax-automatically '(save mode-enabled)))

1.2. Posframe

;; (use-package flycheck-posframe
;;   :custom-face
;;   (flycheck-posframe-face ((t (:foreground ,(face-foreground 'success)))))
;;   (flycheck-posframe-info-face ((t (:foreground ,(face-foreground 'success)))))
;;   (flycheck-posframe-background-face ((t (:inherit tooltip))))
;;   (flycheck-posframe-border-face ((t (:inherit font-lock-comment-face))))
;;   :hook (flycheck-mode . flycheck-posframe-mode)
;;   :init
;;   (setq flycheck-posframe-border-width 1)
;;   (add-hook 'flycheck-posframe-inhibit-functions
;;             (lambda (&rest _) (bound-and-true-p company-backend))))

1.3. Popup Tip

;; (use-package flycheck-popup-tip
;;   :hook (flycheck-mode . flycheck-popup-tip-mode))

1.4. Package Provides

(provide 'init-flycheck)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)