Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.getreg

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.getreg
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { getreg } = fn;

The result is a String, which is the contents of register {regname}. Example:

:let cliptext = getreg('*')

When register {regname} was not set the result is an empty string. The {regname} argument must be a string.

getreg('=') returns the last evaluated value of the expression register. (For use in maps.) getreg('=', 1) returns the expression itself, so that it can be restored with setreg(). For other registers the extra argument is ignored, thus you can always give it.

If {list} is present and TRUE, the result type is changed to List. Each list item is one text line. Use it if you care about zero bytes possibly present inside register: without third argument both NLs and zero bytes are represented as NLs (see NL-used-for-Nul). When the register was not set an empty list is returned.

If {regname} is "", the unnamed register '"' is used. If {regname} is not specified, v:register is used. In Vim9-script {regname} must be one character.

Can also be used as a method:

GetRegname()->getreg()

Parameters

denops: Denops
optional
regname: unknown
optional
v1: unknown
optional
list: unknown

Returns

Promise<string | unknown[]>