lean2/src/emacs
2014-09-09 13:47:09 -07:00
..
CMakeLists.txt feat(emacs): include lean-mode Emacs files in the distribution 2014-01-09 11:50:07 -08:00
eri.el feat(emacs/eri.el): add eri.el (from agda mode) 2014-08-30 14:57:34 -07:00
lean-cmd.el feat(emacs/lean-cmd): add WAIT command 2014-09-08 16:04:19 -07:00
lean-company.el fix(emacs/lean-company): color problem when showing auto-complete candidates 2014-09-09 13:22:58 -07:00
lean-debug.el feat(emacs): implement lean-show-type 2014-08-13 17:02:49 -07:00
lean-flycheck.el feat(emacs/lean-flycheck): "real" .clean file instead of "flycheck_real.clean" 2014-09-08 23:49:02 -07:00
lean-info.el fix(emacs): use looking-at instead of char-after 2014-09-09 13:22:58 -07:00
lean-input.el chore(emacs): minor adjustments to synthax hightlight and input mode 2014-09-06 08:32:05 -07:00
lean-mmm-lua.el feat(emacs/lean-mmm-lua.el): add mmm-mode to syntax-highlight lua code 2014-09-02 10:37:03 -07:00
lean-mode.el feat(emacs/lean-mode): add imenu support 2014-09-09 09:04:31 -07:00
lean-option.el feat(emacs): use lean-server-send-cmd-async 2014-09-04 16:32:07 -07:00
lean-server.el fix(emacs/lean-server): missing 'rx' at the beginning of regex 2014-09-09 13:47:09 -07:00
lean-settings.el feat(emacs/lean-mode): add imenu support 2014-09-09 09:04:31 -07:00
lean-syntax.el feat(frontends/lean): rename '[fact]' to '[visible]' 2014-09-08 07:47:42 -07:00
lean-tags.el fix(emacs/lean-tags): pass lean-flycheck-checker-options properly 2014-09-08 11:27:04 -07:00
lean-type.el fix(emacs): use looking-at instead of char-after 2014-09-09 13:22:58 -07:00
lean-util.el feat(emacs/lean-tags): try to find TAGS file upward and use it without asking 2014-08-26 16:22:32 -07:00
lean-variable.el feat(emacs/lean-cmd): add FINDG cmd 2014-09-08 16:04:19 -07:00
README.md feat(emacs/README.md): add instruction for unicode font 2014-09-05 15:33:59 -07:00

lean-mode

Emacs mode for lean theorem prover

Requirement

lean-mode requires Emacs 24 and following (optional) packages which can be installed via M-x package-install.

Install

Put the following elisp code on your emacs setup (e.g. .emacs.d/init.el):

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(package-refresh-contents)

;; Install required packages for lean-mode
(defvar lean-mode-required-packages
  '(company dash dash-functional flycheck whitespace-cleanup-mode fill-column-indicator))
(dolist (p lean-mode-required-packages)
  (when (not (package-installed-p p))
    (package-install p)))

;; Set up lean-root path
(setq lean-rootdir "~/projects/lean")
(setq-local lean-emacs-path
            (concat (file-name-as-directory lean-rootdir)
                    (file-name-as-directory "src")
                    "emacs"))
(add-to-list 'load-path (expand-file-name lean-emacs-path))
(require 'lean-mode)

;; Customization for lean-mode
(customize-set-variable 'lean-delete-trailing-whitespace t)
(customize-set-variable 'lean-flycheck-use t)
(customize-set-variable 'lean-eldoc-use t)

If experience a problem reading unicode characters on emacs, consider having the following setup:

(when (member "DejaVu Sans Mono" (font-family-list))
  (set-face-attribute 'default nil :font "DejaVu Sans Mono-11"))

Key Bindings

Key Function
C-c C-x lean-std-exe
C-c C-l lean-std-exe
C-c C-t lean-eldoc-documentation-function
C-c C-f lean-fill-placeholder
M-. lean-find-tag
TAB lean-complete-tag
C-c C-o lean-set-option
C-c C-e lean-eval-cmd