This this example Neovim plugin shows how to invoke a Go function from a plugin.
The plugin starts a Go program containing the function as a child process. The plugin invokes functions in the child process using RPC.
Use the following steps to run the plugin:
- Build the program with the go tool to an
executable named
helloremote
. Ensure that the executable is in a directory in thePATH
environment variable.$ cd helloremote $ go build
- Install the plugin in this directory using a plugin manager or by adding this directory to the runtimepath.
- Start Nvim and run the following command:
:Hello world!