agda layer#
The agda layer enables support for the Agda proof assistant/programming
language. This is achieved by using the official Agda Language
Server and
the Cornelis plugin
(i.e., agda-mode aka Emacs
mode, but for
Neovim). The latter requires
stack.
Bindings#
Some default bindings are provided for Cornelis. They are the similar to the ones specified in Cornelis’s example configuration, with two modifications:
<leader>became<leader>a(alike “Agda”) to group such Agda-related bindings together;- the bind for “go to definition” has been replaced in order not to conflict
with the homonymous bind found in the
lsplayer.
In normal mode:
<leader>alloads and type-checks the buffer;<leader>arrefines the goal;<leader>adperforms a case distinction/split;<leader>a,shows goal type and context;<leader>a.shows inferred type of hole contents;<leader>ansolves constraints;<leader>aaperforms an automatic proof search;<leader>aggoes to definition;[/jumps to previous goal;/]jumps to next goal;<C-A>is likeagda-mode’s<C-A>, but also targets sub/super-scripts;<C-X>is likeagda-mode’s<C-X>, but also targets sub/super-scripts.
As described in the Configuration section, binds can be freely overwritten by the user.
Configuration#
On top of the usual lsp and lspconfig fields, the following are available:
cornelis(defaults to{}): a table describing the settings to be used forcornelis. Any vim global variable mentioned in the “Configuration” section of Cornelis is also a valid subfield for this table, as long as you strip thecornelis_prefix;binds(defaults described in the Bindings section): bindings as would be passed to thebindslayer.
Examples#
-- path/of/your/vim/config/init.lua
require("visimp")({
agda = {
lspconfig = {
-- your Agda Language Server config
},
cornelis = {
max_size = 30, -- do not use the cornelis_ prefix for Cornelis settings
},
binds = {
[{
mode = 'i',
bind = '<C-l>',
opts = {
desc = 'Agda: Load and type-check buffer',
},
}] = vim_cmd_cb 'CornelisLoad',
},
},
languages = {
"agda",
}
})