demo.mp4
If you are using neovim 0.12 or later, you can install and configure lean.nvim using
vim.pack.add { "https://github.com/Julian/lean.nvim" }
require("lean").setup { mappings = true }(see the manual for information about the { mappings = true } part).
If you are using an older neovim, or do not wish to use vim.pack, lean.nvim can be installed via your favorite plugin manager.
Here's an example doing so with lazy.nvim:
{
'Julian/lean.nvim',
event = { 'BufReadPre *.lean', 'BufNewFile *.lean' },
dependencies = {
-- optional dependencies:
-- 'nvim-telescope/telescope.nvim', -- for Lean-specific pickers
-- 'andymass/vim-matchup', -- for enhanced % motion behavior
-- 'andrewradev/switch.vim', -- for switch support
-- 'tomtom/tcomment_vim', -- for commenting
},
---@type lean.Config
opts = { -- see the manual for full configuration options
mappings = true,
}
}lean.nvim supports the latest stable neovim release (currently >=0.11.5) as well as the latest nightly.
If you are on an earlier version of neovim, e.g. 0.10.2, you can have your plugin manager install the nvim-0.10 tag until you upgrade.
A portion of lean.nvim's development is graciously sponsored by the Lean FRO.
It is undoubtedly the case that lean.nvim would not be as featureful without this support, for which we owe sincere thanks.
-
Abbreviation (unicode character) insertion (in insert mode & the command window accessible via
q/) -
An infoview which can show persistent goal, term & tactic state, as well as interactive widget support (for most widgets renderable as text)
-
User commands for interacting with infoviews, goals, diagnostics, and the Lean server (e.g.
:LeanGoal,:LeanInfoviewToggle,:LeanRestartFile) -
File progress information for visible lines in the sign column. If satellite.nvim is present, a satellite extension is registered for showing progress information for the whole document within its floating window.
-
vim-matchup definitions for Lean
-
switch.vim base definitions for Lean
-
If telescope.nvim is present, a
:Telescope looglecommand is available as a frontend for the Loogle JSON API. -
Semantic highlighting support -- see the manual for full details and the wiki for a sample color scheme setup
-
Simple snippets (in VSCode-compatible format, usable with e.g. vim-vsnip)
-
Lean library search path access via
lean.current_search_path(), which you might find useful as a set of paths to grep (or live grep) within See the wiki for a sample configuration.
For detail on the full list of supported configuration options, key mappings, and commands, see the manual.
Particularly if you're also a VSCode user, there may be other plugins you're interested in. Below is a (hopelessly incomplete) list of a few:
-
nvim-lightbulb for signalling when code actions are available
-
goto-preview for peeking definitions (instead of jumping to them)
-
neominimap.nvim if you really like minimaps
Contributions are most welcome. Feel free to send pull requests for anything you'd like to see, or open an issue if you'd like to discuss. See CONTRIBUTING.md for details on running tests, linting and testing.
