summaryrefslogtreecommitdiff
path: root/flymake-conf.el
blob: 28f8c4e04bf41b336d2107ceed2cbe31cb790cbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;; flymake-conf.el --- My configurations for Flymake  -*- lexical-binding: t; -*-

;; Copyright (C) 2022  李俊緯

;; Author: 李俊緯 <durand@jsdurand.xyz>
;; Keywords: convenience, help, maint, tools

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; Configure Flymake to my liking.

;;; Code:

(require 'flymake)

(setq flymake-fringe-indicator-position 'left-fringe)
(setq flymake-suppress-zero-counters t)
(setq flymake-start-on-flymake-mode t)
(setq flymake-no-changes-timeout nil)
(setq flymake-start-on-save-buffer t)
(setq flymake-proc-compilation-prevents-syntax-check t)
(setq flymake-wrap-around t)

(define-key flymake-mode-map (vector ?\C-c ?! ?s) #'flymake-start)
(define-key flymake-mode-map (vector ?\C-c ?! ?d) #'flymake-show-buffer-diagnostics)
(define-key flymake-mode-map (vector ?\C-c ?! ?n) #'flymake-goto-next-error)
(define-key flymake-mode-map (vector ?\C-c ?! ?p) #'flymake-goto-prev-error)

(define-key global-map (vector ?\s-m) nil)
(define-key global-map (vector ?\s-m ?s) #'flymake-start)
(define-key global-map (vector ?\s-m ?m) #'flymake-mode)
(define-key global-map (vector ?\s-m ?d) #'flymake-show-buffer-diagnostics)
(define-key global-map (vector ?\s-m ?n) #'flymake-goto-next-error)
(define-key global-map (vector ?\s-m ?p) #'flymake-goto-prev-error)

(provide 'flymake-conf)
;;; flymake-conf.el ends here