Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/variable/mod.ts>globals

๐Ÿ“š Standard module for denops.vim
Go to Latest
variable globals
import { globals } from "https://deno.land/x/denops_std@v5.1.0/variable/mod.ts";

Global variables (globals or g)

import { Denops } from "../mod.ts";
import { globals } from "../variable/mod.ts";

export async function main(denops: Denops): Promise<void> {
  // Set global variable
  await globals.set(denops, "hello", "world");

  // Get global variable
  console.log(await globals.get(denops, "hello"));

  // Remove global variable
  await globals.remove(denops, "hello");
}