Skip to main content
Module

x/ddc_vim/deps.ts>op.define

Dark deno-powered completion framework for neovim/Vim
Latest
variable op.define
import { op } from "https://deno.land/x/ddc_vim@v4.3.1/deps.ts";
const { define } = op;

Pattern to be used to find a macro definition. It is a search pattern, just like for the "/" command. This option is used for the commands like "[i" and "[d" include-search. The 'isident' option is used to recognize the defined name after the match: {match with 'define'}{non-ID chars}{defined name}{non-ID char} See option-backslash about inserting backslashes to include a space or backslash. The default value is for C programs. For C++ this value would be useful, to include const type declarations:

^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)

You can also use "\ze" just before the name and continue the pattern to check what is following. E.g. for Javascript, if a function is defined with "func_name = function(args)":

^\s*\ze\i\+\s*=\s*function(

If the function is defined with "func_name : function() {...":

^\s*\ze\i\+\s*[:]\s*(*function\s*(

When using the ":set" command, you need to double the backslashes! To avoid that use :let with a single quote string:

let &l:define = '^\s*\ze\k\+\s*=\s*function('

(default "^\s*#\s*define")

type

GlobalOrLocalOption<string>