comparison runtime/doc/quickfix.txt @ 27903:d19b7aee1925

Update runtime files. Commit: https://github.com/vim/vim/commit/c51cf0329809c7ae946c59d6f56699227efc9d1b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 26 12:25:45 2022 +0000 Update runtime files.
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Feb 2022 13:30:04 +0100
parents 179c118424a6
children c968191a8557
comparison
equal deleted inserted replaced
27902:8481c8908b5e 27903:d19b7aee1925
1 *quickfix.txt* For Vim version 8.2. Last change: 2022 Feb 08 1 *quickfix.txt* For Vim version 8.2. Last change: 2022 Feb 22
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
351 current quickfix list. If a quickfix list is not 351 current quickfix list. If a quickfix list is not
352 present, then a new list is created. The current 352 present, then a new list is created. The current
353 cursor position will not be changed. See |:cexpr| for 353 cursor position will not be changed. See |:cexpr| for
354 more information. 354 more information.
355 Example: > 355 Example: >
356 :g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".") 356 :g/mypattern/caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")
357 < 357 <
358 *:lad* *:addd* *:laddexpr* 358 *:lad* *:addd* *:laddexpr*
359 :lad[dexpr] {expr} Same as ":caddexpr", except the location list for the 359 :lad[dexpr] {expr} Same as ":caddexpr", except the location list for the
360 current window is used instead of the quickfix list. 360 current window is used instead of the quickfix list.
361 361
652 effect. The file containing the error is opened in the window above the 652 effect. The file containing the error is opened in the window above the
653 quickfix window. If there already is a window for that file, it is used 653 quickfix window. If there already is a window for that file, it is used
654 instead. If the buffer in the used window has changed, and the error is in 654 instead. If the buffer in the used window has changed, and the error is in
655 another file, jumping to the error will fail. You will first have to make 655 another file, jumping to the error will fail. You will first have to make
656 sure the window contains a buffer which can be abandoned. 656 sure the window contains a buffer which can be abandoned.
657
658 The following steps are used to find a window to open the file selected from
659 the quickfix window:
660 1. If 'switchbuf' contains "usetab", then find a window in any tabpage
661 (starting with the first tabpage) that has the selected file and jump to
662 it.
663 2. Otherwise find a window displaying the selected file in the current tab
664 page (starting with the window before the quickfix window) and use it.
665 3. Otherwise find a window displaying a normal buffer ('buftype' is empty)
666 starting with the window before the quickfix window. If a window is found,
667 open the file in that window.
668 4. If a usable window is not found and 'switchbuf' contains "uselast", then
669 open the file in the last used window.
670 5. Otherwise open the file in the window before the quickfix window. If there
671 is no previous window, then open the file in the next window.
672 6. If a usable window is not found in the above steps, then create a new
673 horizontally split window above the quickfix window and open the file.
674
657 *CTRL-W_<Enter>* *CTRL-W_<CR>* 675 *CTRL-W_<Enter>* *CTRL-W_<CR>*
658 You can use CTRL-W <Enter> to open a new window and jump to the error there. 676 You can use CTRL-W <Enter> to open a new window and jump to the error there.
659 677
660 When the quickfix window has been filled, two autocommand events are 678 When the quickfix window has been filled, two autocommand events are
661 triggered. First the 'filetype' option is set to "qf", which triggers the 679 triggered. First the 'filetype' option is set to "qf", which triggers the
662 FileType event (also see |qf.vim|). Then the BufReadPost event is triggered, 680 FileType event (also see |qf.vim|). Then the BufReadPost event is triggered,
663 using "quickfix" for the buffer name. This can be used to perform some action 681 using "quickfix" for the buffer name. This can be used to perform some action
664 on the listed errors. Example: > 682 on the listed errors. Example: >
665 au BufReadPost quickfix setlocal modifiable 683 au BufReadPost quickfix setlocal modifiable
666 \ | silent exe 'g/^/s//\=line(".")." "/' 684 \ | silent exe 'g/^/s//\=line(".") .. " "/'
667 \ | setlocal nomodifiable 685 \ | setlocal nomodifiable
668 This prepends the line number to each line. Note the use of "\=" in the 686 This prepends the line number to each line. Note the use of "\=" in the
669 substitute string of the ":s" command, which is used to evaluate an 687 substitute string of the ":s" command, which is used to evaluate an
670 expression. 688 expression.
671 The BufWinEnter event is also triggered, again using "quickfix" for the buffer 689 The BufWinEnter event is also triggered, again using "quickfix" for the buffer