2018-08-27 12:57:07 +02:00
|
|
|
;;; lang/coq/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2019-10-04 15:33:37 -04:00
|
|
|
;;;###package proof-general
|
2020-02-20 16:52:56 -05:00
|
|
|
(setq proof-splash-enable nil)
|
2019-10-04 15:33:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
;;;###package coq
|
2019-12-27 13:32:24 -05:00
|
|
|
(setq-hook! 'coq-mode-hook
|
|
|
|
;; Doom syncs other indent variables with `tab-width'; we trust major modes to
|
|
|
|
;; set it -- which most of them do -- but coq-mode doesn't, so...
|
|
|
|
tab-width proof-indent
|
|
|
|
;; HACK Fix #2081: Doom continues comments on RET, but coq-mode doesn't have a
|
|
|
|
;; sane `comment-line-break-function', so...
|
|
|
|
comment-line-break-function nil)
|
2019-10-19 04:00:27 -04:00
|
|
|
|
2019-03-02 01:56:32 -05:00
|
|
|
;; We've replaced coq-mode abbrevs with yasnippet snippets (in the snippets
|
|
|
|
;; library included with Doom).
|
2018-10-06 23:45:09 +02:00
|
|
|
(setq coq-mode-abbrev-table '())
|
|
|
|
|
2019-09-07 17:00:23 +09:00
|
|
|
(map! :after coq-mode
|
|
|
|
:map coq-mode-map
|
|
|
|
:localleader
|
|
|
|
"]" #'proof-assert-next-command-interactive
|
|
|
|
"[" #'proof-undo-last-successful-command
|
|
|
|
"." #'proof-goto-point
|
|
|
|
(:prefix ("l" . "layout")
|
|
|
|
"c" #'pg-response-clear-displays
|
|
|
|
"l" #'proof-layout-windows
|
|
|
|
"p" #'proof-prf)
|
|
|
|
(:prefix ("p" . "proof")
|
|
|
|
"i" #'proof-interrupt-process
|
|
|
|
"p" #'proof-process-buffer
|
|
|
|
"q" #'proof-shell-exit
|
|
|
|
"r" #'proof-retract-buffer)
|
|
|
|
(:prefix ("a" . "about/print/check")
|
|
|
|
"a" #'coq-Print
|
|
|
|
"A" #'coq-Print-with-all
|
|
|
|
"b" #'coq-About
|
|
|
|
"B" #'coq-About-with-all
|
|
|
|
"c" #'coq-Check
|
|
|
|
"C" #'coq-Check-show-all
|
|
|
|
"f" #'proof-find-theorems
|
|
|
|
(:prefix ("i" . "implicits")
|
|
|
|
"b" #'coq-About-with-implicits
|
|
|
|
"c" #'coq-Check-show-implicits
|
|
|
|
"i" #'coq-Print-with-implicits))
|
|
|
|
(:prefix ("g" . "goto")
|
|
|
|
"e" #'proof-goto-command-end
|
|
|
|
"l" #'proof-goto-end-of-locked
|
|
|
|
"s" #'proof-goto-command-start)
|
|
|
|
(:prefix ("i" . "insert")
|
|
|
|
"c" #'coq-insert-command
|
|
|
|
"e" #'coq-end-Section
|
|
|
|
"i" #'coq-insert-intros
|
|
|
|
"r" #'coq-insert-requires
|
|
|
|
"s" #'coq-insert-section-or-module
|
|
|
|
"t" #'coq-insert-tactic
|
|
|
|
"T" #'coq-insert-tactical))
|
2019-03-02 01:56:32 -05:00
|
|
|
|
2019-10-04 15:33:37 -04:00
|
|
|
|
2019-10-21 08:46:40 -04:00
|
|
|
;; This package provides more than just code completion, so we load it whether
|
|
|
|
;; or not :completion company is enabled.
|
|
|
|
(use-package! company-coq
|
|
|
|
:hook (coq-mode . company-coq-mode)
|
|
|
|
:config
|
2018-12-03 22:23:57 -05:00
|
|
|
(set-popup-rule! "^\\*\\(?:response\\|goals\\)\\*" :ignore t)
|
2018-08-27 13:57:00 +02:00
|
|
|
(set-lookup-handlers! 'company-coq-mode
|
|
|
|
:definition #'company-coq-jump-to-definition
|
2018-08-27 14:11:14 +02:00
|
|
|
:references #'company-coq-grep-symbol
|
2018-08-27 13:57:00 +02:00
|
|
|
:documentation #'company-coq-doc)
|
2019-10-21 08:46:40 -04:00
|
|
|
|
2019-11-17 01:21:11 +09:00
|
|
|
(setq company-coq-disabled-features '(hello company-defaults))
|
|
|
|
|
2019-11-17 01:22:12 +09:00
|
|
|
(if (featurep! :completion company)
|
2020-03-27 01:25:30 -04:00
|
|
|
(define-key coq-mode-map [remap company-complete-common]
|
|
|
|
#'company-indent-or-complete-common)
|
2019-10-21 08:46:40 -04:00
|
|
|
;; `company-coq''s company defaults impose idle-completion on folks, so
|
2020-03-27 01:25:30 -04:00
|
|
|
;; we'll set up company ourselves. See
|
|
|
|
;; https://github.com/cpitclaudel/company-coq/issues/42
|
2019-11-17 01:22:12 +09:00
|
|
|
(add-to-list 'company-coq-disabled-features 'company))
|
2019-10-21 08:46:40 -04:00
|
|
|
|
2019-09-07 17:00:23 +09:00
|
|
|
(map! :map coq-mode-map
|
|
|
|
:localleader
|
2019-10-04 15:33:37 -04:00
|
|
|
"ao" #'company-coq-occur
|
|
|
|
(:prefix "i"
|
2019-09-07 17:00:23 +09:00
|
|
|
"l" #'company-coq-lemma-from-goal
|
|
|
|
"m" #'company-coq-insert-match-construct)
|
|
|
|
(:prefix ("h" . "help")
|
|
|
|
"e" #'company-coq-document-error
|
|
|
|
"E" #'company-coq-browse-error-messages
|
|
|
|
"h" #'company-coq-doc)))
|