{"id":18495949,"url":"https://github.com/leanprover/lean3-mode","last_synced_at":"2025-04-08T22:32:03.978Z","repository":{"id":24837738,"uuid":"94858931","full_name":"leanprover/lean3-mode","owner":"leanprover","description":"Emacs mode for Lean","archived":true,"fork":false,"pushed_at":"2023-06-11T07:28:43.000Z","size":857,"stargazers_count":70,"open_issues_count":10,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-16T23:42:05.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leanprover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-20T06:47:43.000Z","updated_at":"2024-12-03T18:26:37.000Z","dependencies_parsed_at":"2024-11-06T13:31:49.552Z","dependency_job_id":"a22da4ac-8751-42b4-9c4d-e876065f5483","html_url":"https://github.com/leanprover/lean3-mode","commit_stats":null,"previous_names":["leanprover/lean3-mode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean3-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean3-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean3-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean3-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/lean3-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247940634,"owners_count":21022016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:27:07.647Z","updated_at":"2025-04-08T22:32:03.967Z","avatar_url":"https://github.com/leanprover.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is the Emacs mode for the [Lean 3 theorem prover][lean].\n\n[lean]: https://github.com/leanprover/lean\n\nInstallation\n============\n\n`lean-mode` requires GNU Emacs 24.3 or newer. The recommended way to install it is via [MELPA](https://melpa.org). If you have not already configured MELPA, put the following code in your Emacs init file (typically `~/.emacs.d/init.el`):\n```elisp\n(require 'package) ; You might already have this line\n(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))\n(package-initialize) ; You might already have this line\n```\nSee also [MELPA: Getting Started](https://melpa.org/#/getting-started).\n\nWith MELPA configured, you can `M-x package-install` the packages `lean-mode` and `company-lean`. The latter package gives you auto completion and is strongly recommended. There is a third package, `helm-lean`, which provides a searchable list of declarations on `C-c C-d` using the Helm interface. `helm-lean` requires Emacs 24.4 or newer.\n\nFor `company-lean`, you should also bind a key to trigger completion, if you have not already done so:\n\n```elisp\n;; Trigger completion on Shift-Space\n(global-set-key (kbd \"S-SPC\") #'company-complete)\n```\n\nUpdating\n--------\n\nFor updating the Lean MELPA packages, use `package-list-packages`. See the section \"Updating Packages\" on [MELPA: Getting Started](https://melpa.org/#/getting-started) for details.\n\nTrying It Out\n=============\n\nIf things are working correctly, you should see the word ``Lean`` in the\nEmacs mode line when you open a file with extension `.lean`. If you type\n```lean\n#check id\n```\nthe word ``#check`` will be underlined, and hovering over it will show\nyou the type of ``id``. The mode line will show ``FlyC:0/1``, indicating\nthat there are no errors and one piece of information displayed.\n\nKey Bindings and Commands\n=========================\n\n| Key                | Function                                                                        |\n|--------------------|---------------------------------------------------------------------------------|\n| \u003ckbd\u003eM-.\u003c/kbd\u003e     | jump to definition in source file (`lean-find-definition`)                      |\n| \u003ckbd\u003eM-,\u003c/kbd\u003e     | jump back to position before \u003ckbd\u003eM-.\u003c/kbd\u003e (`xref-pop-marker-stack`)           |\n| \u003ckbd\u003eC-c C-k\u003c/kbd\u003e | shows the keystroke needed to input the symbol under the cursor                 |\n| \u003ckbd\u003eC-c C-x\u003c/kbd\u003e | execute lean in stand-alone mode (`lean-std-exe`)                               |\n| \u003ckbd\u003eC-c SPC\u003c/kbd\u003e | run a command on the hole at point (`lean-hole`)                                |\n| \u003ckbd\u003eC-c C-d\u003c/kbd\u003e | show a searchable list of definitions (`helm-lean-definitions`)                 |\n| \u003ckbd\u003eC-c C-g\u003c/kbd\u003e | toggle showing current tactic proof goal (`lean-toggle-show-goal`)              |\n| \u003ckbd\u003eC-c C-n\u003c/kbd\u003e | toggle showing next error in dedicated buffer (`lean-toggle-next-error`)        |\n| \u003ckbd\u003eC-c C-b\u003c/kbd\u003e | toggle showing output in inline boxes (`lean-message-boxes-toggle`)             |\n| \u003ckbd\u003eC-c C-r\u003c/kbd\u003e | restart the lean server (`lean-server-restart`)                                 |\n| \u003ckbd\u003eC-c C-s\u003c/kbd\u003e | switch to a different Lean version via [elan](https://github.com/Kha/elan) (`lean-server-switch-version`) |\n| \u003ckbd\u003eC-c ! n\u003c/kbd\u003e | flycheck: go to next error                                                      |\n| \u003ckbd\u003eC-c ! p\u003c/kbd\u003e | flycheck: go to previous error                                                  |\n| \u003ckbd\u003eC-c ! l\u003c/kbd\u003e | flycheck: show list of errors                                                   |\n\nIn the default configuration, the Flycheck annotation `FlyC:n/n` indicates the\nnumber of errors / responses from Lean; clicking on `FlyC` opens the Flycheck menu.\n\n\nMessage Boxes\n================\nTo view the output of commands such as `check` and `print` in boxes in the buffer, enable the feature using \u003ckbd\u003eC-c C-b\u003c/kbd\u003e.\nIf you then type\n```lean\n#check id\n```\na box appears after the line showing the type of `id`. Customize `lean-message-boxes-enabled-captions` to choose categories of boxes.\nIn particular, add `\"trace output\"` to the list to see proof states and other traces in the buffer.\n\nKnown Issues and Possible Solutions\n===================================\n\nUnicode\n-------\n\nIf you experience a problem rendering unicode symbols on emacs,\nplease download the following fonts and install them on your machine:\n\n - [Quivira.ttf](http://www.quivira-font.com/files/Quivira.ttf)\n - [Dejavu Fonts](http://sourceforge.net/projects/dejavu/files/dejavu/2.35/dejavu-fonts-ttf-2.35.tar.bz2)\n - [NotoSans](https://github.com/googlei18n/noto-fonts/blob/master/hinted/NotoSans-Regular.ttc?raw=true)\n - [NotoSansSymbols](https://github.com/googlei18n/noto-fonts/blob/master/unhinted/NotoSansSymbols-Regular.ttf?raw=true)\n\nThen, have the following lines in your emacs setup to use `DejaVu Sans Mono` font:\n\n```elisp\n(when (member \"DejaVu Sans Mono\" (font-family-list))\n  (set-face-attribute 'default nil :font \"DejaVu Sans Mono-11\"))\n```\n\nYou may also need to install the [emacs-unicode-fonts](https://github.com/rolandwalker/unicode-fonts) package, after which you should add the following lines to your emacs setup:\n\n```elisp\n(require 'unicode-fonts)\n(unicode-fonts-setup)\n```\n\nContributions\n=============\n\nContributions are welcome!\n\nBuilding from Source\n--------------------\n\nWhen working on `lean-mode` itself, it is much easier to just `require` the sources than repeatedly building the MELPA packages:\n\n```elisp\n(add-to-list 'load-path \"~/path/to/lean-mode/\")\n(require 'lean-mode)\n(require 'company-lean)\n(require 'helm-lean)\n```\n\nMake sure you have the packages' dependencies listed on MELPA installed -- the easiest way to do this may be to just install the official Lean MELPA packages and making sure the `require` commands above are execute before `package-initialize`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flean3-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Flean3-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flean3-mode/lists"}