Home Explore Blog CI



neovim

10th chunk of `runtime/doc/tagsrch.txt`
d77ddd16a1993d056084cd49d7cd434e54eb03b020f23de40000000100000fa5
 backslash in
the search text.  This is for backwards compatibility with Vi.

							*E434* *E435*
If the command is a normal search command (it starts and ends with "/" or
"?"), some special handling is done:
- Searching starts on line 1 of the file.
  The direction of the search is forward for "/", backward for "?".
  Note that 'wrapscan' does not matter, the whole file is always searched.
- If the search fails, another try is done ignoring case.  If that fails too,
  a search is done for: >
	"^tagname[ \t]*("
<  (the tag with '^' prepended and "[ \t]*(" appended).  When using function
  names, this will find the function name when it is in column 0.  This will
  help when the arguments to the function have changed since the tags file was
  made.  If this search also fails another search is done with: >
	"^[#a-zA-Z_].*\<tagname[ \t]*("
<  This means: A line starting with '#' or an identifier and containing the tag
  followed by white space and a '('.  This will find macro names and function
  names with a type prepended.


							*tag-old-static*
Until March 2019 (patch 8.1.1092) an outdated format was supported:
    {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}

This format is for a static tag only.  It is obsolete now, replaced by
the second format.  It is only supported by Elvis 1.x, older Vim versions and
a few versions of ctags.  A static tag is often used for functions that are
local, only referenced in the file {tagfile}.  Note that for the static tag,
the two occurrences of {tagfile} must be exactly the same.  Also see
|tags-option| below, for how static tags are used.

The support was removed, since when you can update to the new Vim version you
should also be able to update ctags to one that supports the second format.

==============================================================================
6. Include file searches		*include-search* *definition-search*
							*E387* *E388* *E389*

These commands look for a string in the current file and in all encountered
included files (recursively).  This can be used to find the definition of a
variable, function or macro.  If you only want to search in the current
buffer, use the commands listed at |pattern-searches|.

When a line is encountered that includes another file, that file is searched
before continuing in the current buffer.  Files included by included files are
also searched.  When an include file could not be found it is silently
ignored.  Use the |:checkpath| command to discover which files could not be
found, possibly your 'path' option is not set up correctly.  Note: the
included file is searched, not a buffer that may be editing that file.  Only
for the current file the lines in the buffer are used.

The string can be any keyword or a defined macro.  For the keyword any match
will be found.  For defined macros only lines that match with the 'define'
option will be found.  The default is "^#\s*define", which is for C programs.
For other languages you probably want to change this.  See 'define' for an
example for C++.  The string cannot contain an end-of-line, only matches
within a line are found.

When a match is found for a defined macro, the displaying of lines continues
with the next line when a line ends in a backslash.

The commands that start with "[" start searching from the start of the current
file.  The commands that start with "]" start at the current cursor position.

The 'include' option is used to define a line that includes another file.  The
default is "\^#\s*include", which is for C programs.  Note: Vim does not
recognize C syntax, if the 'include' option matches a line inside
"#ifdef/#endif" or inside a comment, it is searched anyway.  The 'isfname'
option is used to recognize the file name that comes after the matched
pattern.

The 'path' option is used to find the directory for the include files that
do not have an absolute path.

The 'comments' option is used for the commands that display a single line or
jump to a line.  It defines

Title: Tag Search Details, Obsolete Static Tag Format, and Include File Searches
Summary
This section explains how Vim handles tag searches, including the special treatment of search commands and the fallback strategies when initial searches fail. It also describes an obsolete format for static tags and details how Vim performs recursive searches in include files to locate definitions of variables, functions, or macros, emphasizing the use of 'include', 'path', and 'define' options to tailor the search behavior for different programming languages.