Skip to main content
Module

x/ddc_vim/deps.ts>fn.getbufvar

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.getbufvar
import { fn } from "https://deno.land/x/ddc_vim@v2.3.0/deps.ts";
const { getbufvar } = fn;

The result is the value of option or local buffer variable {varname} in buffer {expr}. Note that the name without "b:" must be used. When {varname} is empty returns a |Dictionary| with all the buffer-local variables. When {varname} is equal to "&" returns a |Dictionary| with all the buffer-local options. Otherwise, when {varname} starts with "&" returns the value of a buffer-local option. This also works for a global or buffer-local option, but it doesn't work for a global variable, window-local variable or window-local option. For the use of {expr}, see |bufname()| above. When the buffer or variable doesn't exist {def} or an empty string is returned, there is no error message. Examples: :let bufmodified = getbufvar(1, "&mod") :echo "todo myvar = " . getbufvar("todo", "myvar") Can also be used as a |method|: GetBufnr()->getbufvar(varname)

Parameters

denops: Denops
expr: unknown
varname: unknown
optional
def: unknown

Returns

Promise<unknown>