Skip to main content
Module

x/dpp_vim/deps.ts>fn.searchdecl

Dark powered plugin manager for Vim/neovim
Latest
function fn.searchdecl
import { fn } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";
const { searchdecl } = fn;

Search for the declaration of {name}.

With a non-zero {global} argument it works like gD, find first match in the file. Otherwise it works like gd, find first match in the function.

With a non-zero {thisblock} argument matches in a {} block that ends before the cursor position are ignored. Avoids finding variable declarations only valid in another scope.

Moves the cursor to the found match. Returns zero for success, non-zero for failure. Example:

if searchdecl('myvar') == 0
   echo getline('.')
endif

Can also be used as a method:

GetName()->searchdecl()

Parameters

denops: Denops
name: unknown
optional
global: unknown
optional
thisblock: unknown

Returns

Promise<number>