aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/quickfix.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/quickfix.txt')
-rw-r--r--runtime/doc/quickfix.txt65
1 files changed, 52 insertions, 13 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index cad5bf98b5..f280286290 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -6,7 +6,7 @@
This subject is introduced in section |30.1| of the user manual.
- Type <M-]> to see the table of contents.
+ Type |gO| to see the table of contents.
=============================================================================
1. Using QuickFix commands *quickfix* *Quickfix* *E42*
@@ -31,11 +31,21 @@ From inside Vim an easy way to run a command and handle the output is with the
The 'errorformat' option should be set to match the error messages from your
compiler (see |errorformat| below).
+ *quickfix-ID*
+Each quickfix list has a unique identifier called the quickfix ID and this
+number will not change within a Vim session. The getqflist() function can be
+used to get the identifier assigned to a list. There is also a quickfix list
+number which may change whenever more than ten lists are added to a quickfix
+stack.
+
*location-list* *E776*
-A location list is similar to a quickfix list and contains a list of positions
-in files. A location list is associated with a window and each window can
-have a separate location list. A location list can be associated with only
-one window. The location list is independent of the quickfix list.
+A location list is a window-local quickfix list. You get one after commands
+like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a
+location list instead of a quickfix list as the corresponding `:vimgrep`,
+`:grep`, `:helpgrep`, `:make` do.
+A location list is associated with a window and each window can have a
+separate location list. A location list can be associated with only one
+window. The location list is independent of the quickfix list.
When a window with a location list is split, the new window gets a copy of the
location list. When there are no longer any references to a location list,
@@ -138,11 +148,15 @@ processing a quickfix or location list command, it will be aborted.
current window is used instead of the quickfix list.
*:cq* *:cquit*
-:cq[uit][!] Quit Vim with an error code, so that the compiler
- will not compile the same file again.
- WARNING: All changes in files are lost! Also when the
- [!] is not used. It works like ":qall!" |:qall|,
- except that Vim returns a non-zero exit code.
+:[count]cq[uit] Quit Nvim with an error code, or the code specified in
+ [count]. Useful when Nvim is called from another
+ program: e.g. `git commit` will abort the comitting
+ process, `fc` (built-in for shells like bash and zsh)
+ will not execute the command.
+
+ WARNING: All changes in files are lost. It works like
+ ":qall!" |:qall|, except that Nvim exits non-zero or
+ [count].
*:cf* *:cfile*
:cf[ile][!] [errorfile] Read the error file and jump to the first error.
@@ -151,6 +165,9 @@ processing a quickfix or location list command, it will be aborted.
keep Vim running while compiling. If you give the
name of the errorfile, the 'errorfile' option will
be set to [errorfile]. See |:cc| for [!].
+ If the encoding of the error file differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
*:lf* *:lfile*
:lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
@@ -162,6 +179,9 @@ processing a quickfix or location list command, it will be aborted.
:cg[etfile] [errorfile] *:cg* *:cgetfile*
Read the error file. Just like ":cfile" but don't
jump to the first error.
+ If the encoding of the error file differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
:lg[etfile] [errorfile] *:lg* *:lgetfile*
@@ -172,6 +192,9 @@ processing a quickfix or location list command, it will be aborted.
:caddf[ile] [errorfile] Read the error file and add the errors from the
errorfile to the current quickfix list. If a quickfix
list is not present, then a new list is created.
+ If the encoding of the error file differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
*:laddf* *:laddfile*
:laddf[ile] [errorfile] Same as ":caddfile", except the location list for the
@@ -308,6 +331,7 @@ use this code: >
endfunction
au QuickfixCmdPost make call QfMakeConv()
+Another option is using 'makeencoding'.
EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
*:cdo*
@@ -446,7 +470,11 @@ keep its height, ignoring 'winheight' and 'equalalways'. You can change the
height manually (e.g., by dragging the status line above it with the mouse).
In the quickfix window, each line is one error. The line number is equal to
-the error number. You can use ":.cc" to jump to the error under the cursor.
+the error number. The current entry is highlighted with the QuickFixLine
+highlighting. You can change it to your liking, e.g.: >
+ :hi QuickFixLine ctermbg=Yellow guibg=Yellow
+
+You can use ":.cc" to jump to the error under the cursor.
Hitting the <Enter> key or double-clicking the mouse on a line has the same
effect. The file containing the error is opened in the window above the
quickfix window. If there already is a window for that file, it is used
@@ -572,6 +600,9 @@ lists, use ":cnewer 99" first.
like |:cnext| and |:cprevious|, see above.
This command does not accept a comment, any "
characters are considered part of the arguments.
+ If the encoding of the program output differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
*:lmak* *:lmake*
:lmak[e][!] [arguments]
@@ -631,6 +662,7 @@ read the error messages: >
au QuickfixCmdPost make call QfMakeConv()
(Example by Faque Cheng)
+Another option is using 'makeencoding'.
==============================================================================
5. Using :vimgrep and :grep *grep* *lid*
@@ -745,6 +777,9 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
When 'grepprg' is "internal" this works like
|:vimgrep|. Note that the pattern needs to be
enclosed in separator characters then.
+ If the encoding of the program output differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
*:lgr* *:lgrep*
:lgr[ep][!] [arguments] Same as ":grep", except the location list for the
@@ -769,6 +804,10 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
\ | catch /E480:/
\ | endtry"
<
+ If the encoding of the program output differs from the
+ 'encoding' option, you can use the 'makeencoding'
+ option to specify the encoding.
+
*:lgrepa* *:lgrepadd*
:lgrepa[dd][!] [arguments]
Same as ":grepadd", except the location list for the
@@ -1358,7 +1397,7 @@ prints information about entering a directory in the form "Making all in dir".
Making all in dir2 ./dir1/dir2
This can be solved by printing absolute directories in the "enter directory"
- message or by printing "leave directory" messages..
+ message or by printing "leave directory" messages.
To avoid this problem, ensure to print absolute directory names and "leave
directory" messages.
@@ -1534,4 +1573,4 @@ by Vim.
- vim:tw=78:ts=8:ft=help:norl:
+ vim:noet:tw=78:ts=8:ft=help:norl: