2016-08-25 04:38:03 +00:00
|
|
|
;;; packages.el --- coq layer packages file for Spacemacs.
|
|
|
|
;;
|
2018-10-13 17:44:50 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2016-08-25 04:38:03 +00:00
|
|
|
;;
|
|
|
|
;; Author: Jeremy Bi <bixuanxbi@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(setq coq-packages
|
|
|
|
'(
|
2017-07-03 07:52:54 +00:00
|
|
|
(company-coq :requires company)
|
2018-09-02 03:19:09 +00:00
|
|
|
proof-general
|
2016-08-25 04:38:03 +00:00
|
|
|
smartparens
|
|
|
|
vi-tilde-fringe
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun coq/init-company-coq ()
|
|
|
|
(use-package company-coq
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2017-02-13 03:08:36 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(add-hook 'coq-mode-hook #'company-coq-mode)
|
|
|
|
(add-to-list 'spacemacs-jump-handlers-coq-mode
|
2017-02-13 04:45:56 +00:00
|
|
|
'company-coq-jump-to-definition)
|
|
|
|
(setq company-coq-disabled-features '(hello)))
|
2016-08-25 04:38:03 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2017-02-13 04:45:56 +00:00
|
|
|
(spacemacs|hide-lighter company-coq-mode)
|
2018-08-09 18:06:46 +00:00
|
|
|
(dolist (prefix '(("mi" . "coq/insert")
|
|
|
|
("mh" . "coq/document")))
|
|
|
|
(spacemacs/declare-prefix-for-mode
|
|
|
|
'coq-mode
|
|
|
|
(car prefix) (cdr prefix)))
|
2016-08-25 04:38:03 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'coq-mode
|
|
|
|
"il" 'company-coq-lemma-from-goal
|
|
|
|
"im" 'company-coq-insert-match-construct
|
2018-08-09 18:06:46 +00:00
|
|
|
"ao" 'company-coq-occur
|
|
|
|
"he" 'company-coq-document-error
|
|
|
|
"hE" 'company-coq-browse-error-messages
|
|
|
|
"hh" 'company-coq-doc))))
|
2016-08-25 04:38:03 +00:00
|
|
|
|
|
|
|
(defun coq/init-proof-general ()
|
|
|
|
(use-package proof-site
|
|
|
|
:mode ("\\.v\\'" . coq-mode)
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-08-25 04:38:03 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq coq/proof-general-load-path
|
|
|
|
(concat (configuration-layer/get-elpa-package-install-directory
|
2017-02-13 04:45:56 +00:00
|
|
|
'proof-general) "generic")
|
2016-08-25 04:38:03 +00:00
|
|
|
proof-three-window-mode-policy 'hybrid
|
|
|
|
proof-script-fly-past-comments t
|
|
|
|
proof-splash-seen t)
|
2017-02-13 04:45:56 +00:00
|
|
|
(add-to-list 'load-path coq/proof-general-load-path))
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs|hide-lighter holes-mode)
|
|
|
|
(spacemacs|hide-lighter proof-active-buffer-fake-minor-mode)
|
|
|
|
;; key bindings
|
2016-08-25 04:38:03 +00:00
|
|
|
(dolist (prefix '(("ml" . "pg/layout")
|
|
|
|
("mp" . "pg/prover")
|
|
|
|
("ma" . "pg/ask-prover")
|
|
|
|
("mai" . "show-implicits")
|
|
|
|
("mg" . "pg/goto")))
|
|
|
|
(spacemacs/declare-prefix-for-mode
|
|
|
|
'coq-mode
|
|
|
|
(car prefix) (cdr prefix)))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'coq-mode
|
|
|
|
;; Basic proof management
|
|
|
|
"]" 'proof-assert-next-command-interactive
|
|
|
|
"[" 'proof-undo-last-successful-command
|
|
|
|
"." 'proof-goto-point
|
|
|
|
;; Layout
|
|
|
|
"lc" 'pg-response-clear-displays
|
2017-02-13 03:08:36 +00:00
|
|
|
"ll" 'proof-layout-windows
|
2016-08-25 04:38:03 +00:00
|
|
|
"lp" 'proof-prf
|
|
|
|
;; Prover Interaction
|
2017-02-13 03:08:36 +00:00
|
|
|
"pi" 'proof-interrupt-process
|
|
|
|
"pp" 'proof-process-buffer
|
|
|
|
"pq" 'proof-shell-exit
|
2016-08-25 04:38:03 +00:00
|
|
|
"pr" 'proof-retract-buffer
|
|
|
|
;; Prover queries ('ask prover')
|
2017-02-13 03:08:36 +00:00
|
|
|
"aa" 'coq-Print
|
|
|
|
"aA" 'coq-Print-with-all
|
2016-08-25 04:38:03 +00:00
|
|
|
"ab" 'coq-About
|
2017-02-13 03:08:36 +00:00
|
|
|
"aB" 'coq-About-with-all
|
|
|
|
"ac" 'coq-Check
|
|
|
|
"aC" 'coq-Check-show-all
|
|
|
|
"af" 'proof-find-theorems
|
2016-08-25 04:38:03 +00:00
|
|
|
"aib" 'coq-About-with-implicits
|
2017-02-13 03:08:36 +00:00
|
|
|
"aic" 'coq-Check-show-implicits
|
|
|
|
"aii" 'coq-Print-with-implicits
|
2016-08-25 04:38:03 +00:00
|
|
|
;; Moving the point (goto)
|
|
|
|
"ge" 'proof-goto-command-end
|
2017-02-13 03:08:36 +00:00
|
|
|
"gl" 'proof-goto-end-of-locked
|
|
|
|
"gs" 'proof-goto-command-start
|
2016-08-25 04:38:03 +00:00
|
|
|
;; Insertions
|
2018-08-03 00:24:54 +00:00
|
|
|
"ic" 'coq-insert-command
|
|
|
|
"ie" 'coq-end-Section
|
|
|
|
"ii" 'coq-insert-intros
|
|
|
|
"ir" 'coq-insert-requires
|
|
|
|
"is" 'coq-insert-section-or-module
|
|
|
|
"it" 'coq-insert-tactic
|
2020-02-11 20:46:39 +00:00
|
|
|
"iT" 'coq-insert-tactical
|
|
|
|
;; Options
|
|
|
|
"Te" 'proof-electric-terminator-toggle))))
|
2016-08-25 04:38:03 +00:00
|
|
|
|
2018-03-04 04:37:53 +00:00
|
|
|
(defun coq/post-init-smartparens ()
|
|
|
|
(spacemacs/add-to-hooks (if dotspacemacs-smartparens-strict-mode
|
|
|
|
'smartparens-strict-mode
|
|
|
|
'smartparens-mode)
|
|
|
|
'(coq-mode-hook)))
|
2016-08-25 04:38:03 +00:00
|
|
|
|
|
|
|
(defun coq/post-init-vi-tilde-fringe ()
|
|
|
|
(spacemacs/add-to-hooks 'spacemacs/disable-vi-tilde-fringe
|
|
|
|
'(coq-response-mode-hook
|
|
|
|
coq-goals-mode-hook)))
|