2018-08-21 12:46:29 +02:00
|
|
|
;;; lang/agda/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2018-08-22 03:52:53 +02:00
|
|
|
(defvar +agda-dir
|
2018-08-22 03:53:19 +02:00
|
|
|
(when (executable-find "agda-mode")
|
2018-08-25 17:27:42 +02:00
|
|
|
(file-name-directory (shell-command-to-string "agda-mode locate"))))
|
2018-08-21 12:46:29 +02:00
|
|
|
|
2018-08-25 17:27:42 +02:00
|
|
|
(def-package! agda-input
|
|
|
|
:load-path +agda-dir)
|
2018-08-21 12:46:29 +02:00
|
|
|
|
2018-08-25 17:27:42 +02:00
|
|
|
(def-package! agda2-mode
|
|
|
|
:mode "\\.agda\\'"
|
|
|
|
:after agda-input
|
2018-09-03 13:54:49 +02:00
|
|
|
:init
|
2018-09-03 16:00:40 +02:00
|
|
|
;; make syntax-highlighting more consistent with other major modes
|
2018-09-03 13:54:49 +02:00
|
|
|
(progn
|
|
|
|
(mapc
|
|
|
|
(lambda (x) (add-to-list 'face-remapping-alist x))
|
2018-09-03 15:45:43 +02:00
|
|
|
'((agda2-highlight-keyword-face . font-lock-keyword-face)
|
|
|
|
(agda2-highlight-string-face . font-lock-string-face)
|
|
|
|
(agda2-highlight-number-face . font-lock-string-face)
|
|
|
|
(agda2-highlight-symbol-face . font-lock-variable-name-face)
|
|
|
|
(agda2-highlight-primitive-type-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-bound-variable-face . font-lock-variable-name-face)
|
|
|
|
(agda2-highlight-inductive-constructor-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-coinductive-constructor-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-datatype-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-field-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-function-face . font-lock-function-name-face)
|
|
|
|
(agda2-highlight-module-face . font-lock-variable-name-face)
|
|
|
|
(agda2-highlight-postulate-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-primitive-face . font-lock-type-face)
|
|
|
|
(agda2-highlight-macro-face . font-lock-function-name-face)
|
|
|
|
(agda2-highlight-record-face . font-lock-type-face)
|
2018-09-03 16:00:40 +02:00
|
|
|
(agda2-highlight-error-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-dotted-face . font-lock-variable-name-face)
|
|
|
|
(agda2-highlight-unsolved-meta-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-unsolved-constraint-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-termination-problem-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-positivity-problem-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-incomplete-pattern-face . font-lock-warning-face)
|
|
|
|
(agda2-highlight-typechecks-face . font-lock-warning-face))))
|
2018-08-25 17:27:42 +02:00
|
|
|
:config
|
|
|
|
(map! :map agda2-mode-map
|
|
|
|
:localleader
|
|
|
|
:n "l" #'agda2-load
|
|
|
|
:n "d" #'agda2-infer-type-maybe-toplevel
|
|
|
|
:n "o" #'agda2-module-contents-maybe-toplevel
|
|
|
|
:n "n" #'agda2-compute-normalised-maybe-toplevel))
|
2018-09-03 13:54:49 +02:00
|
|
|
;; TODO finish keybindings
|