import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { expandcmd } = fn;
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()