-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgplan.el
46 lines (37 loc) · 1.13 KB
/
pgplan.el
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
(require 'generic-x)
(define-generic-mode
'pgplan-mode
'("--")
'()
'()
'("\\.pgplan$" "\\.plan$")
nil
"A mode for postgresql query plan"
)
(font-lock-add-keywords
'pgplan-mode
'(("-> *\\(Hash[^(:]*\\|Result\\)" . 'font-lock-keyword-face)
("-> *[^>]* Scan" . 'font-lock-string-face)
("-> *\\(Redistribute Motion\\|Gather Motion\\)" . 'font-lock-doc-face)
("-> *\\(Broadcast Motion\\|Append \\|Window\\|\\<Aggregate\\|GroupAggregate\\)" . 'font-lock-variable-name-face)
("-> *\\(Sort\\|Unique\\|Materialize\\|Nested Loop\\)" . 'font-lock-warning-face)
("slice[0-9]*" . font-lock-function-name-face)
("cost=[0-9.]*" . font-lock-keyword-face)
("Avg *[0-9.]*" . font-lock-keyword-face)
("Max *[0-9.]*" . font-lock-function-name-face)
("\\([1-9]\\|[0-9]\\+[0-9]\\) spilling" . font-lock-warning-face)
))
(add-hook
'pgplan-mode-hook
(lambda () (yafolding-mode)))
(add-hook
'pgplan-mode-hook
(lambda () (hl-line-mode)))
(add-hook
'pgplan-mode-hook
(lambda () (setq buffer-read-only t)))
(add-hook
'pgplan-mode-hook
(lambda () (setq truncate-lines t)))
(require 'yafolding)
(provide 'pgplan)