Home Explore Blog CI



neovim

49th chunk of `runtime/doc/vimfn.txt`
7051ec5765b2a595fa564b191842c4cab391a380fbe872100000000100000fab
 that has the file name, use
				bufname() to get the name
			module	module name
			lnum	line number in the buffer (first line is 1)
			end_lnum
				end of line number if the item is multiline
			col	column number (first column is 1)
			end_col	end of column number if the item has range
			vcol	|TRUE|: "col" is visual column
				|FALSE|: "col" is byte index
			nr	error number
			pattern	search pattern used to locate the error
			text	description of the error
			type	type of the error, 'E', '1', etc.
			valid	|TRUE|: recognized error message
			user_data
				custom data associated with the item, can be
				any type.

		When there is no error list or it's empty, an empty list is
		returned. Quickfix list entries with a non-existing buffer
		number are returned with "bufnr" set to zero (Note: some
		functions accept buffer number zero for the alternate buffer,
		you may need to explicitly check for zero).

		Useful application: Find pattern matches in multiple files and
		do something with them: >vim
			vimgrep /theword/jg *.c
			for d in getqflist()
			   echo bufname(d.bufnr) ':' d.lnum '=' d.text
			endfor
<
		If the optional {what} dictionary argument is supplied, then
		returns only the items listed in {what} as a dictionary. The
		following string items are supported in {what}:
			changedtick	get the total number of changes made
					to the list |quickfix-changedtick|
			context	get the |quickfix-context|
			efm	errorformat to use when parsing "lines". If
				not present, then the 'errorformat' option
				value is used.
			id	get information for the quickfix list with
				|quickfix-ID|; zero means the id for the
				current list or the list specified by "nr"
			idx	get information for the quickfix entry at this
				index in the list specified by "id" or "nr".
				If set to zero, then uses the current entry.
				See |quickfix-index|
			items	quickfix list entries
			lines	parse a list of lines using 'efm' and return
				the resulting entries.  Only a |List| type is
				accepted.  The current quickfix list is not
				modified. See |quickfix-parse|.
			nr	get information for this quickfix list; zero
				means the current quickfix list and "$" means
				the last quickfix list
			qfbufnr number of the buffer displayed in the quickfix
				window. Returns 0 if the quickfix buffer is
				not present. See |quickfix-buffer|.
			size	number of entries in the quickfix list
			title	get the list title |quickfix-title|
			winid	get the quickfix |window-ID|
			all	all of the above quickfix properties
		Non-string items in {what} are ignored. To get the value of a
		particular item, set it to zero.
		If "nr" is not present then the current quickfix list is used.
		If both "nr" and a non-zero "id" are specified, then the list
		specified by "id" is used.
		To get the number of lists in the quickfix stack, set "nr" to
		"$" in {what}. The "nr" value in the returned dictionary
		contains the quickfix stack size.
		When "lines" is specified, all the other items except "efm"
		are ignored.  The returned dictionary contains the entry
		"items" with the list of entries.

		The returned dictionary contains the following entries:
			changedtick	total number of changes made to the
					list |quickfix-changedtick|
			context	quickfix list context. See |quickfix-context|
				If not present, set to "".
			id	quickfix list ID |quickfix-ID|. If not
				present, set to 0.
			idx	index of the quickfix entry in the list. If not
				present, set to 0.
			items	quickfix list entries. If not present, set to
				an empty list.
			nr	quickfix list number. If not present, set to 0
			qfbufnr	number of the buffer displayed in the quickfix
				window. If not present, set to 0.
			size	number of entries in the quickfix list. If not
				present, set to 0.
			title	quickfix list title text. If not present, set
				to "".
			winid	quickfix |window-ID|. If not present, set to 0

		Examples (See also |getqflist-examples|): >vim
			echo getqflist({'all': 1})
			echo getqflist({'nr':

Title: Deep Dive into `getqflist()` Functionality and its Applications
Summary
This section delves deeper into the functionality of the `getqflist()` function, detailing the structure and content of the list it returns. It lists all the entries within the dictionary: `bufnr`, `module`, `lnum`, `end_lnum`, `col`, `end_col`, `vcol`, `nr`, `pattern`, `text`, `type`, `valid`, and `user_data`. It provides a code example demonstrating how to find pattern matches in multiple files using `vimgrep` and process them with `getqflist()`. The section also covers the optional `{what}` dictionary argument, explaining how it can be used to retrieve specific information about the quickfix list, such as `changedtick`, `context`, `efm`, `id`, `idx`, `items`, `lines`, `nr`, `qfbufnr`, `size`, `title`, `winid` or `all`. It also clarifies the structure and content of the returned dictionary, including entries like `changedtick`, `context`, `id`, `idx`, `items`, `nr`, `qfbufnr`, `size`, and `title` and provides several illustrative examples.