Skip to main content
Module

x/denops_std/option/mod.ts>includeexpr

📚 Standard module for denops.vim
Go to Latest
variable includeexpr
import { includeexpr } from "https://deno.land/x/denops_std@v4.1.4/option/mod.ts";

{not available when compiled without the |+find_in_path| or |+eval| features} Expression to be used to transform the string found with the 'include' option to a file name. Mostly useful to change "." to "/" for Java: > :set includeexpr=substitute(v:fname,'\.','/','g') < The "v:fname" variable will be set to the file name that was detected.

Also used for the |gf| command if an unmodified file name can't be found. Allows doing "gf" on the name after an 'include' statement. Also used for ||.

If the expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > set includeexpr=s:MyIncludeExpr(v:fname) set includeexpr=SomeIncludeExpr(v:fname) < Otherwise, the expression is evaluated in the context of the script where the option was set, thus script-local items are available.

The expression will be evaluated in the |sandbox| when set from a modeline, see |sandbox-option|. This option cannot be set in a modeline when 'modelineexpr' is off.

It is not allowed to change text or jump to another window while evaluating 'includeexpr' |textlock|.

type

{ get(denops: Denops): Promise<string>; set(denops: Denops, value: string): Promise<void>; reset(denops: Denops): Promise<void>; getLocal(denops: Denops): Promise<string>; setLocal(denops: Denops, value: string): Promise<void>; resetLocal(denops: Denops): Promise<void>; }