Home Explore Blog CI



neovim

11th chunk of `runtime/doc/tagsrch.txt`
f44d2df6dea201e5fef4cc78c94357f1f04f333bd4814f9a0000000100000fa0
 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 patterns that may start a comment.  Those lines
are ignored for the search, unless [!] is used.  One exception: When the line
matches the pattern `"^# *define"` it is not considered to be a comment.

If you want to list matches, and then select one to jump to, you could use a
mapping to do that for you.  Here is an example: >

  :map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " .. nr .. "[\t"<CR>
<
							*[i*
[i			Display the first line that contains the keyword
			under the cursor.  The search starts at the beginning
			of the file.  Lines that look like a comment are
			ignored (see 'comments' option).  If a count is given,
			the count'th matching line is displayed, and comment
			lines are not ignored.

							*]i*
]i			like "[i", but start at the current cursor position.

							*:is* *:isearch*
:[range]is[earch][!] [count] [/]pattern[/]
			Like "[i"  and "]i", but search in [range] lines
			(default: whole file).
			See |:search-args| for [/] and [!].

							*[I*
[I			Display all lines that contain the keyword under the
			cursor.  Filenames and line numbers are displayed
			for the found lines.  The search starts at the
			beginning of the file.

							*]I*
]I			like "[I", but start at the current cursor position.

							*:il* *:ilist*
:[range]il[ist][!] [/]pattern[/]
			Like "[I" and "]I", but search in [range] lines
			(default: whole file).
			See |:search-args| for [/] and [!].

							*[_CTRL-I*
[ CTRL-I		Jump to the first line that contains the keyword
			under the cursor.  The search starts at the beginning
			of the file.  Lines that look like a comment are
			ignored (see 'comments' option).  If a count is given,
			the count'th matching line is jumped to, and comment
			lines are not ignored.

							*]_CTRL-I*
] CTRL-I		like "[ CTRL-I", but start at the current cursor
			position.

							*:ij* *:ijump*
:[range]ij[ump][!] [count] [/]pattern[/]
			Like "[ CTRL-I"  and "] CTRL-I", but search in
			[range] lines (default: whole file).
			See |:search-args| for [/] and [!].

CTRL-W CTRL-I					*CTRL-W_CTRL-I* *CTRL-W_i*
CTRL-W i		Open a new window, with the cursor on the first line
			that contains the keyword under the cursor.  The
			search starts at the beginning of the file.  Lines
			that look like a comment line are ignored (see
			'comments' option).  If a count is given, the count'th
			matching line is jumped to, and comment lines are not
			ignored.

							*:isp* *:isplit*
:[range]isp[lit][!] [count] [/]pattern[/]
			Like "CTRL-W i"  and "CTRL-W i", but search in
			[range] lines (default: whole file).
			See |:search-args| for [/] and [!].

							*[d*
[d			Display the first macro definition that contains the
			macro under the cursor.  The search starts from the
			beginning of the file.  If a count is given, the
			count'th matching line is displayed.

							*[d-default*
			Jumps to the previous diagnostic in the current buffer
			by default. |vim.diagnostic.jump()| |default-mappings|

							*]d*

Title: Include File Search Options and Commands
Summary
This section details the options ('define', 'include', 'isfname', 'path', 'comments') that control include file searches in Vim. It also describes various commands (e.g., [i, ]i, [I, ]I, [CTRL-I, ]CTRL-I) and their variants for finding and displaying lines containing keywords or macro definitions, including options to ignore comments and start the search from different positions within the file, as well as commands to jump to the matching line or open it in a new window.