import { define } from "https://deno.land/x/denops_std@v6.5.1/option/mod.ts";
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")