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

x/denops_std/function/mod.ts>expandcmd

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

Expand special items in String {string} like what is done for an Ex command such as :edit. This expands special keywords, like with expand(), and environment variables, anywhere in {string}. "~user" and "~/path" are only expanded at the start.

The following items are supported in the {options} Dict argument: errmsg If set to TRUE, error messages are displayed if an error is encountered during expansion. By default, error messages are not displayed.

Returns the expanded string. If an error is encountered during expansion, the unmodified {string} is returned.

Example:

:echo expandcmd('make %<.o')
make /path/runtime/doc/builtin.o
:echo expandcmd('make %<.o', {'errmsg': v:true})

Can also be used as a method:

GetCommand()->expandcmd()

Parameters

denops: Denops
string: unknown
optional
options: unknown

Returns

Promise<string>