Scripts client reference
These helper functions are available in the client object in scripts.
client.global.set
Set a variable.
Variables are persisted across script runs and Neovim restarts.
client.global.set("SOME_TOKEN", "123");
client.global.get
Get a variable.
Variables are persisted across script runs and Neovim restarts.
client.log(client.global.get("SOME_TOKEN"));
client.log
Logs arbitrary data to the console.
client.log("Hello, world!");
client.test
warning
Not yet implemented.
client.assert
warning
Not yet implemented.
client.exit
Terminates execution of the response handler script.
client.exit();
client.isEmpty
Checks whether the global
object has no variables defined.
const isEmpty = client.isEmpty();
if (isEmpty) {
client.log("No global variables defined");
}
client.clear
Removes the varName
variable from the global variables storage.
client.clear("SOME_TOKEN");
client.clearAll
Removes all variables from the global variables storage.
client.clearAll();