A Neovim Plugin to streamline implementing interfaces in Go.
- Neovim 0.9 or greater
- Go 1.16 or greater
First, install impl
to generate a list of available interfaces.
go install github.com/jack-rabe/impl@latest
Then, use your preferred method or plugin manager to install impl.nvim. It looks like this for lazy.nvim.
-- init.lua:
{
'jack-rabe/impl.nvim',
dependencies = {
'nvim-telescope/telescope.nvim',
}
}
- Run the command
ImplGenerate stdlib
to generate a list of all the interfaces in the standard library. - Run the command
ImplGenerate project
to generate a list of all the interfaces in your current git repo. - Run the command
ImplSearch
while your cursor is on top of a type definition to fuzzy find a list of available interfaces to implement. The necessary methods will be added once an interface is selected.- Note: it is possible to change the appearance of the telescope finder by calling
impl.setup
.
- Note: it is possible to change the appearance of the telescope finder by calling
require('impl').setup({
layout_strategy = 'vertical',
layout_config = { width = 0.5 }
})
lazy.nvim will call setup
automatically if you specify opts.