.emacs.d/lisp/init-flymake.el
2024-09-06 11:42:11 +02:00

34 lines
1.3 KiB
EmacsLisp

;;; init-flymake.el --- Configure Flymake global behaviour -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(maybe-require-package 'flymake "1.2.1")
;; Use flycheck checkers with flymake, to extend its coverage
(when (maybe-require-package 'flymake-flycheck)
;; Disable flycheck checkers for which we have flymake equivalents
(with-eval-after-load 'flycheck
(setq-default
flycheck-disabled-checkers
(append (default-value 'flycheck-disabled-checkers)
'(emacs-lisp emacs-lisp-checkdoc emacs-lisp-package sh-shellcheck))))
(add-hook 'flymake-mode-hook 'flymake-flycheck-auto)
(add-hook 'prog-mode-hook 'flymake-mode)
(add-hook 'text-mode-hook 'flymake-mode))
(with-eval-after-load 'flymake
;; Provide some flycheck-like bindings in flymake mode to ease transition
(define-key flymake-mode-map (kbd "C-c ! l") 'flymake-show-buffer-diagnostics)
(define-key flymake-mode-map (kbd "C-c ! n") 'flymake-goto-next-error)
(define-key flymake-mode-map (kbd "C-c ! p") 'flymake-goto-prev-error)
(define-key flymake-mode-map (kbd "C-c ! c") 'flymake-start))
(setq eldoc-documentation-function 'eldoc-documentation-compose)
(add-hook 'flymake-mode-hook
(lambda ()
(add-hook 'eldoc-documentation-functions 'flymake-eldoc-function nil t)))
(provide 'init-flymake)
;;; init-flymake.el ends here