Skip to content

The Ant plugin gives Neovim completion, diagnostics, navigation, formatting, and debugging with nvim-dap. ​

Get it on GitHub

Completion, with documentation. ​

Names in scope on CTRL-X CTRL-O, the fields of a record, and the functions a pipe can continue with, each with its documentation.

Errors beside the line. ​

An error shows on leaving insert mode, as a sign and a message beside the line, and CTRL-W d opens it in full.

Fixes from the checker. ​

gra offers the server's fix for a missing field.

The declaration on K. ​

K shows the declaration and its doc comment, for the standard library and your own code.

Signature help as you call. ​

CTRL-S shows the signature of the call being typed, with the current parameter marked.

Inferred types, shown inline. ​

Once vim.lsp.inlay_hint.enable(true) turns them on, inlay hints show the type of every var and the name of every argument.

Formatted by ant fmt. ​

vim.lsp.buf.format() runs ant fmt, and the BufWritePre autocommand from the README makes it format on save.

Indentation as ant fmt lays it out. ​

Indentation follows ant fmt as you type, and gcc comments a line with //.

Go to definition, across files. ​

CTRL-] opens the declaration, in another file too, and CTRL-O goes back.

Every reference, in the quickfix list. ​

grr lists the references of a name in the quickfix list.

Rename, everywhere. ​

grn renames a variable and every use of it.

The symbols of a file. ​

gO lists the file's symbols in the location list.

Run in a terminal. ​

:Ant run runs the current file with ant run in a terminal, and :make runs ant check into the quickfix list.

Run one test from the code. ​

The code lens above a test runs it alone, and :Ant test-nearest runs the test the cursor is in.

Debug with nvim-dap. ​

:Ant debug runs the current file under ant dap: breakpoints, stopping, values on hover, scopes, stepping, and the program's output.

Get it on GitHub

The plugin needs Neovim 0.11 or later, and nvim-dap for debugging. Install shows how to add it with lazy.nvim or as a package, and where ant comes from.