PageRenderTime 66ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/vim72/doc/quickfix.txt

https://bitbucket.org/serge.smolau/vim
Plain Text | 1443 lines | 1160 code | 283 blank | 0 comment | 0 complexity | ee533d3bbc4d3c957da7db0946bcc837 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. *quickfix.txt* For Vim version 7.2. Last change: 2009 May 24
  2. VIM REFERENCE MANUAL by Bram Moolenaar
  3. This subject is introduced in section |30.1| of the user manual.
  4. 1. Using QuickFix commands |quickfix|
  5. 2. The error window |quickfix-window|
  6. 3. Using more than one list of errors |quickfix-error-lists|
  7. 4. Using :make |:make_makeprg|
  8. 5. Using :grep |grep|
  9. 6. Selecting a compiler |compiler-select|
  10. 7. The error format |error-file-format|
  11. 8. The directory stack |quickfix-directory-stack|
  12. 9. Specific error file formats |errorformats|
  13. {Vi does not have any of these commands}
  14. The quickfix commands are not available when the |+quickfix| feature was
  15. disabled at compile time.
  16. =============================================================================
  17. 1. Using QuickFix commands *quickfix* *Quickfix* *E42*
  18. Vim has a special mode to speedup the edit-compile-edit cycle. This is
  19. inspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
  20. The idea is to save the error messages from the compiler in a file and use Vim
  21. to jump to the errors one by one. You can examine each problem and fix it,
  22. without having to remember all the error messages.
  23. In Vim the quickfix commands are used more generally to find a list of
  24. positions in files. For example, |:vimgrep| finds pattern matches. You can
  25. use the positions in a script with the |getqflist()| function. Thus you can
  26. do a lot more than the edit/compile/fix cycle!
  27. If you are using Manx's Aztec C compiler on the Amiga look here for how to use
  28. it with Vim: |quickfix-manx|. If you are using another compiler you should
  29. save the error messages in a file and start Vim with "vim -q filename". An
  30. easy way to do this is with the |:make| command (see below). The
  31. 'errorformat' option should be set to match the error messages from your
  32. compiler (see |errorformat| below).
  33. *location-list* *E776*
  34. A location list is similar to a quickfix list and contains a list of positions
  35. in files. A location list is associated with a window and each window can
  36. have a separate location list. A location list can be associated with only
  37. one window. The location list is independent of the quickfix list.
  38. When a window with a location list is split, the new window gets a copy of the
  39. location list. When there are no references to a location list, the location
  40. list is destroyed.
  41. The following quickfix commands can be used. The location list commands are
  42. similar to the quickfix commands, replacing the 'c' prefix in the quickfix
  43. command with 'l'.
  44. *:cc*
  45. :cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
  46. error is displayed again. Without [!] this doesn't
  47. work when jumping to another buffer, the current buffer
  48. has been changed, there is the only window for the
  49. buffer and both 'hidden' and 'autowrite' are off.
  50. When jumping to another buffer with [!] any changes to
  51. the current buffer are lost, unless 'hidden' is set or
  52. there is another window for this buffer.
  53. The 'switchbuf' settings are respected when jumping
  54. to a buffer.
  55. *:ll*
  56. :ll[!] [nr] Same as ":cc", except the location list for the
  57. current window is used instead of the quickfix list.
  58. *:cn* *:cnext* *E553*
  59. :[count]cn[ext][!] Display the [count] next error in the list that
  60. includes a file name. If there are no file names at
  61. all, go to the [count] next error. See |:cc| for
  62. [!] and 'switchbuf'.
  63. *:lne* *:lnext*
  64. :[count]lne[xt][!] Same as ":cnext", except the location list for the
  65. current window is used instead of the quickfix list.
  66. :[count]cN[ext][!] *:cp* *:cprevious* *:cN* *:cNext*
  67. :[count]cp[revious][!] Display the [count] previous error in the list that
  68. includes a file name. If there are no file names at
  69. all, go to the [count] previous error. See |:cc| for
  70. [!] and 'switchbuf'.
  71. :[count]lN[ext][!] *:lp* *:lprevious* *:lN* *:lNext*
  72. :[count]lp[revious][!] Same as ":cNext" and ":cprevious", except the location
  73. list for the current window is used instead of the
  74. quickfix list.
  75. *:cnf* *:cnfile*
  76. :[count]cnf[ile][!] Display the first error in the [count] next file in
  77. the list that includes a file name. If there are no
  78. file names at all or if there is no next file, go to
  79. the [count] next error. See |:cc| for [!] and
  80. 'switchbuf'.
  81. *:lnf* *:lnfile*
  82. :[count]lnf[ile][!] Same as ":cnfile", except the location list for the
  83. current window is used instead of the quickfix list.
  84. :[count]cNf[ile][!] *:cpf* *:cpfile* *:cNf* *:cNfile*
  85. :[count]cpf[ile][!] Display the last error in the [count] previous file in
  86. the list that includes a file name. If there are no
  87. file names at all or if there is no next file, go to
  88. the [count] previous error. See |:cc| for [!] and
  89. 'switchbuf'.
  90. :[count]lNf[ile][!] *:lpf* *:lpfile* *:lNf* *:lNfile*
  91. :[count]lpf[ile][!] Same as ":cNfile" and ":cpfile", except the location
  92. list for the current window is used instead of the
  93. quickfix list.
  94. *:crewind* *:cr*
  95. :cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
  96. error is displayed. See |:cc|.
  97. *:lrewind* *:lr*
  98. :lr[ewind][!] [nr] Same as ":crewind", except the location list for the
  99. current window is used instead of the quickfix list.
  100. *:cfirst* *:cfir*
  101. :cfir[st][!] [nr] Same as ":crewind".
  102. *:lfirst* *:lfir*
  103. :lfir[st][!] [nr] Same as ":lrewind".
  104. *:clast* *:cla*
  105. :cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
  106. error is displayed. See |:cc|.
  107. *:llast* *:lla*
  108. :lla[st][!] [nr] Same as ":clast", except the location list for the
  109. current window is used instead of the quickfix list.
  110. *:cq* *:cquit*
  111. :cq[uit][!] Quit Vim with an error code, so that the compiler
  112. will not compile the same file again.
  113. WARNING: All changes in files are lost! Also when the
  114. [!] is not used. It works like ":qall!" |:qall|,
  115. except that Vim returns a non-zero exit code.
  116. *:cf* *:cfile*
  117. :cf[ile][!] [errorfile] Read the error file and jump to the first error.
  118. This is done automatically when Vim is started with
  119. the -q option. You can use this command when you
  120. keep Vim running while compiling. If you give the
  121. name of the errorfile, the 'errorfile' option will
  122. be set to [errorfile]. See |:cc| for [!].
  123. *:lf* *:lfile*
  124. :lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
  125. current window is used instead of the quickfix list.
  126. You can not use the -q command-line option to set
  127. the location list.
  128. :cg[etfile] [errorfile] *:cg* *:cgetfile*
  129. Read the error file. Just like ":cfile" but don't
  130. jump to the first error.
  131. :lg[etfile] [errorfile] *:lg* *:lgetfile*
  132. Same as ":cgetfile", except the location list for the
  133. current window is used instead of the quickfix list.
  134. *:caddf* *:caddfile*
  135. :caddf[ile] [errorfile] Read the error file and add the errors from the
  136. errorfile to the current quickfix list. If a quickfix
  137. list is not present, then a new list is created.
  138. *:laddf* *:laddfile*
  139. :laddf[ile] [errorfile] Same as ":caddfile", except the location list for the
  140. current window is used instead of the quickfix list.
  141. *:cb* *:cbuffer* *E681*
  142. :cb[uffer][!] [bufnr] Read the error list from the current buffer.
  143. When [bufnr] is given it must be the number of a
  144. loaded buffer. That buffer will then be used instead
  145. of the current buffer.
  146. A range can be specified for the lines to be used.
  147. Otherwise all lines in the buffer are used.
  148. See |:cc| for [!].
  149. *:lb* *:lbuffer*
  150. :lb[uffer][!] [bufnr] Same as ":cbuffer", except the location list for the
  151. current window is used instead of the quickfix list.
  152. *:cgetb* *:cgetbuffer*
  153. :cgetb[uffer] [bufnr] Read the error list from the current buffer. Just
  154. like ":cbuffer" but don't jump to the first error.
  155. *:lgetb* *:lgetbuffer*
  156. :lgetb[uffer] [bufnr] Same as ":cgetbuffer", except the location list for
  157. the current window is used instead of the quickfix
  158. list.
  159. *:caddb* *:caddbuffer*
  160. :caddb[uffer] [bufnr] Read the error list from the current buffer and add
  161. the errors to the current quickfix list. If a
  162. quickfix list is not present, then a new list is
  163. created. Otherwise, same as ":cbuffer".
  164. *:laddb* *:laddbuffer*
  165. :laddb[uffer] [bufnr] Same as ":caddbuffer", except the location list for
  166. the current window is used instead of the quickfix
  167. list.
  168. *:cex* *:cexpr* *E777*
  169. :cex[pr][!] {expr} Create a quickfix list using the result of {expr} and
  170. jump to the first error. If {expr} is a String, then
  171. each new-line terminated line in the String is
  172. processed using 'errorformat' and the result is added
  173. to the quickfix list. If {expr} is a List, then each
  174. String item in the list is processed and added to the
  175. quickfix list. Non String items in the List are
  176. ignored. See |:cc|
  177. for [!].
  178. Examples: >
  179. :cexpr system('grep -n xyz *')
  180. :cexpr getline(1, '$')
  181. <
  182. *:lex* *:lexpr*
  183. :lex[pr][!] {expr} Same as ":cexpr", except the location list for the
  184. current window is used instead of the quickfix list.
  185. *:cgete* *:cgetexpr*
  186. :cgete[xpr] {expr} Create a quickfix list using the result of {expr}.
  187. Just like ":cexpr", but don't jump to the first error.
  188. *:lgete* *:lgetexpr*
  189. :lgete[xpr] {expr} Same as ":cgetexpr", except the location list for the
  190. current window is used instead of the quickfix list.
  191. *:cad* *:caddexpr*
  192. :cad[dexpr] {expr} Evaluate {expr} and add the resulting lines to the
  193. current quickfix list. If a quickfix list is not
  194. present, then a new list is created. The current
  195. cursor position will not be changed. See |:cexpr| for
  196. more information.
  197. Example: >
  198. :g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
  199. <
  200. *:lad* *:laddexpr*
  201. :lad[dexpr] {expr} Same as ":caddexpr", except the location list for the
  202. current window is used instead of the quickfix list.
  203. *:cl* *:clist*
  204. :cl[ist] [from] [, [to]]
  205. List all errors that are valid |quickfix-valid|.
  206. If numbers [from] and/or [to] are given, the respective
  207. range of errors is listed. A negative number counts
  208. from the last error backwards, -1 being the last error.
  209. The 'switchbuf' settings are respected when jumping
  210. to a buffer.
  211. :cl[ist]! [from] [, [to]]
  212. List all errors.
  213. *:lli* *:llist*
  214. :lli[st] [from] [, [to]]
  215. Same as ":clist", except the location list for the
  216. current window is used instead of the quickfix list.
  217. :lli[st]! [from] [, [to]]
  218. List all the entries in the location list for the
  219. current window.
  220. If you insert or delete lines, mostly the correct error location is still
  221. found because hidden marks are used. Sometimes, when the mark has been
  222. deleted for some reason, the message "line changed" is shown to warn you that
  223. the error location may not be correct. If you quit Vim and start again the
  224. marks are lost and the error locations may not be correct anymore.
  225. If vim is built with |+autocmd| support, two autocommands are available for
  226. running commands before and after a quickfix command (':make', ':grep' and so
  227. on) is executed. See |QuickFixCmdPre| and |QuickFixCmdPost| for details.
  228. *QuickFixCmdPost-example*
  229. When 'encoding' differs from the locale, the error messages may have a
  230. different encoding from what Vim is using. To convert the messages you can
  231. use this code: >
  232. function QfMakeConv()
  233. let qflist = getqflist()
  234. for i in qflist
  235. let i.text = iconv(i.text, "cp936", "utf-8")
  236. endfor
  237. call setqflist(qflist)
  238. endfunction
  239. au QuickfixCmdPost make call QfMakeConv()
  240. =============================================================================
  241. 2. The error window *quickfix-window*
  242. *:cope* *:copen*
  243. :cope[n] [height] Open a window to show the current list of errors.
  244. When [height] is given, the window becomes that high
  245. (if there is room). Otherwise the window is made ten
  246. lines high.
  247. The window will contain a special buffer, with
  248. 'buftype' equal to "quickfix". Don't change this!
  249. If there already is a quickfix window, it will be made
  250. the current window. It is not possible to open a
  251. second quickfix window.
  252. *:lop* *:lopen*
  253. :lop[en] [height] Open a window to show the location list for the
  254. current window. Works only when the location list for
  255. the current window is present. You can have more than
  256. one location window opened at a time. Otherwise, it
  257. acts the same as ":copen".
  258. *:ccl* *:cclose*
  259. :ccl[ose] Close the quickfix window.
  260. *:lcl* *:lclose*
  261. :lcl[ose] Close the window showing the location list for the
  262. current window.
  263. *:cw* *:cwindow*
  264. :cw[indow] [height] Open the quickfix window when there are recognized
  265. errors. If the window is already open and there are
  266. no recognized errors, close the window.
  267. *:lw* *:lwindow*
  268. :lw[indow] [height] Same as ":cwindow", except use the window showing the
  269. location list for the current window.
  270. Normally the quickfix window is at the bottom of the screen. If there are
  271. vertical splits, it's at the bottom of the rightmost column of windows. To
  272. make it always occupy the full width: >
  273. :botright cwindow
  274. You can move the window around with |window-moving| commands.
  275. For example, to move it to the top: CTRL-W K
  276. The 'winfixheight' option will be set, which means that the window will mostly
  277. keep its height, ignoring 'winheight' and 'equalalways'. You can change the
  278. height manually (e.g., by dragging the status line above it with the mouse).
  279. In the quickfix window, each line is one error. The line number is equal to
  280. the error number. You can use ":.cc" to jump to the error under the cursor.
  281. Hitting the <Enter> key or double-clicking the mouse on a line has the same
  282. effect. The file containing the error is opened in the window above the
  283. quickfix window. If there already is a window for that file, it is used
  284. instead. If the buffer in the used window has changed, and the error is in
  285. another file, jumping to the error will fail. You will first have to make
  286. sure the window contains a buffer which can be abandoned.
  287. *CTRL-W_<Enter>* *CTRL-W_<CR>*
  288. You can use CTRL-W <Enter> to open a new window and jump to the error there.
  289. When the quickfix window has been filled, two autocommand events are
  290. triggered. First the 'filetype' option is set to "qf", which triggers the
  291. FileType event. Then the BufReadPost event is triggered, using "quickfix" for
  292. the buffer name. This can be used to perform some action on the listed
  293. errors. Example: >
  294. au BufReadPost quickfix setlocal modifiable
  295. \ | silent exe 'g/^/s//\=line(".")." "/'
  296. \ | setlocal nomodifiable
  297. This prepends the line number to each line. Note the use of "\=" in the
  298. substitute string of the ":s" command, which is used to evaluate an
  299. expression.
  300. The BufWinEnter event is also triggered, again using "quickfix" for the buffer
  301. name.
  302. Note: Making changes in the quickfix window has no effect on the list of
  303. errors. 'modifiable' is off to avoid making changes. If you delete or insert
  304. lines anyway, the relation between the text and the error number is messed up.
  305. If you really want to do this, you could write the contents of the quickfix
  306. window to a file and use ":cfile" to have it parsed and used as the new error
  307. list.
  308. *location-list-window*
  309. The location list window displays the entries in a location list. When you
  310. open a location list window, it is created below the current window and
  311. displays the location list for the current window. The location list window
  312. is similar to the quickfix window, except that you can have more than one
  313. location list window open at a time. When you use a location list command in
  314. this window, the displayed location list is used.
  315. When you select a file from the location list window, the following steps are
  316. used to find a window to edit the file:
  317. 1. If a window with the location list displayed in the location list window is
  318. present, then the file is opened in that window.
  319. 2. If the above step fails and if the file is already opened in another
  320. window, then that window is used.
  321. 3. If the above step fails then an existing window showing a buffer with
  322. 'buftype' not set is used.
  323. 4. If the above step fails, then the file is edited in a new window.
  324. In all of the above cases, if the location list for the selected window is not
  325. yet set, then it is set to the location list displayed in the location list
  326. window.
  327. =============================================================================
  328. 3. Using more than one list of errors *quickfix-error-lists*
  329. So far has been assumed that there is only one list of errors. Actually the
  330. ten last used lists are remembered. When starting a new list, the previous
  331. ones are automatically kept. Two commands can be used to access older error
  332. lists. They set one of the existing error lists as the current one.
  333. *:colder* *:col* *E380*
  334. :col[der] [count] Go to older error list. When [count] is given, do
  335. this [count] times. When already at the oldest error
  336. list, an error message is given.
  337. *:lolder* *:lol*
  338. :lol[der] [count] Same as ":colder", except use the location list for
  339. the current window instead of the quickfix list.
  340. *:cnewer* *:cnew* *E381*
  341. :cnew[er] [count] Go to newer error list. When [count] is given, do
  342. this [count] times. When already at the newest error
  343. list, an error message is given.
  344. *:lnewer* *:lnew*
  345. :lnew[er] [count] Same as ":cnewer", except use the location list for
  346. the current window instead of the quickfix list.
  347. When adding a new error list, it becomes the current list.
  348. When ":colder" has been used and ":make" or ":grep" is used to add a new error
  349. list, one newer list is overwritten. This is especially useful if you are
  350. browsing with ":grep" |grep|. If you want to keep the more recent error
  351. lists, use ":cnewer 99" first.
  352. =============================================================================
  353. 4. Using :make *:make_makeprg*
  354. *:mak* *:make*
  355. :mak[e][!] [arguments] 1. If vim was built with |+autocmd|, all relevant
  356. |QuickFixCmdPre| autocommands are executed.
  357. 2. If the 'autowrite' option is on, write any changed
  358. buffers
  359. 3. An errorfile name is made from 'makeef'. If
  360. 'makeef' doesn't contain "##", and a file with this
  361. name already exists, it is deleted.
  362. 4. The program given with the 'makeprg' option is
  363. started (default "make") with the optional
  364. [arguments] and the output is saved in the
  365. errorfile (for Unix it is also echoed on the
  366. screen).
  367. 5. The errorfile is read using 'errorformat'.
  368. 6. If vim was built with |+autocmd|, all relevant
  369. |QuickFixCmdPost| autocommands are executed.
  370. See example below.
  371. 7. If [!] is not given the first error is jumped to.
  372. 8. The errorfile is deleted.
  373. 9. You can now move through the errors with commands
  374. like |:cnext| and |:cprevious|, see above.
  375. This command does not accept a comment, any "
  376. characters are considered part of the arguments.
  377. *:lmak* *:lmake*
  378. :lmak[e][!] [arguments]
  379. Same as ":make", except the location list for the
  380. current window is used instead of the quickfix list.
  381. The ":make" command executes the command given with the 'makeprg' option.
  382. This is done by passing the command to the shell given with the 'shell'
  383. option. This works almost like typing
  384. ":!{makeprg} [arguments] {shellpipe} {errorfile}".
  385. {makeprg} is the string given with the 'makeprg' option. Any command can be
  386. used, not just "make". Characters '%' and '#' are expanded as usual on a
  387. command-line. You can use "%<" to insert the current file name without
  388. extension, or "#<" to insert the alternate file name without extension, for
  389. example: >
  390. :set makeprg=make\ #<.o
  391. [arguments] is anything that is typed after ":make".
  392. {shellpipe} is the 'shellpipe' option.
  393. {errorfile} is the 'makeef' option, with ## replaced to make it unique.
  394. The placeholder "$*" can be used for the argument list in {makeprg} if the
  395. command needs some additional characters after its arguments. The $* is
  396. replaced then by all arguments. Example: >
  397. :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
  398. or simpler >
  399. :let &mp = 'latex \\nonstopmode \\input\{$*}'
  400. "$*" can be given multiple times, for example: >
  401. :set makeprg=gcc\ -o\ $*\ $*
  402. The 'shellpipe' option defaults to ">" for the Amiga, MS-DOS and Win32. This
  403. means that the output of the compiler is saved in a file and not shown on the
  404. screen directly. For Unix "| tee" is used. The compiler output is shown on
  405. the screen and saved in a file the same time. Depending on the shell used
  406. "|& tee" or "2>&1| tee" is the default, so stderr output will be included.
  407. If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
  408. for compilers that write to an errorfile themselves (e.g., Manx's Amiga C).
  409. Using QuickFixCmdPost to fix the encoding ~
  410. It may be that 'encoding' is set to an encoding that differs from the messages
  411. your build program produces. This example shows how to fix this after Vim has
  412. read the error messages: >
  413. function QfMakeConv()
  414. let qflist = getqflist()
  415. for i in qflist
  416. let i.text = iconv(i.text, "cp936", "utf-8")
  417. endfor
  418. call setqflist(qflist)
  419. endfunction
  420. au QuickfixCmdPost make call QfMakeConv()
  421. (Example by Faque Cheng)
  422. ==============================================================================
  423. 5. Using :vimgrep and :grep *grep* *lid*
  424. Vim has two ways to find matches for a pattern: Internal and external. The
  425. advantage of the internal grep is that it works on all systems and uses the
  426. powerful Vim search patterns. An external grep program can be used when the
  427. Vim grep does not do what you want.
  428. The internal method will be slower, because files are read into memory. The
  429. advantages are:
  430. - Line separators and encoding are automatically recognized, as if a file is
  431. being edited.
  432. - Uses Vim search patterns. Multi-line patterns can be used.
  433. - When plugins are enabled: compressed and remote files can be searched.
  434. |gzip| |netrw|
  435. To be able to do this Vim loads each file as if it is being edited. When
  436. there is no match in the file the associated buffer is wiped out again. The
  437. 'hidden' option is ignored here to avoid running out of memory or file
  438. descriptors when searching many files. However, when the |:hide| command
  439. modifier is used the buffers are kept loaded. This makes following searches
  440. in the same files a lot faster.
  441. 5.1 using Vim's internal grep
  442. *:vim* *:vimgrep* *E682* *E683*
  443. :vim[grep][!] /{pattern}/[g][j] {file} ...
  444. Search for {pattern} in the files {file} ... and set
  445. the error list to the matches.
  446. Without the 'g' flag each line is added only once.
  447. With 'g' every match is added.
  448. {pattern} is a Vim search pattern. Instead of
  449. enclosing it in / any non-ID character (see
  450. |'isident'|) can be used, so long as it does not
  451. appear in {pattern}.
  452. 'ignorecase' applies. To overrule it put |/\c| in the
  453. pattern to ignore case or |/\C| to match case.
  454. 'smartcase' is not used.
  455. When a number is put before the command this is used
  456. as the maximum number of matches to find. Use
  457. ":1vimgrep pattern file" to find only the first.
  458. Useful if you only want to check if there is a match
  459. and quit quickly when it's found.
  460. Without the 'j' flag Vim jumps to the first match.
  461. With 'j' only the quickfix list is updated.
  462. With the [!] any changes in the current buffer are
  463. abandoned.
  464. Every second or so the searched file name is displayed
  465. to give you an idea of the progress made.
  466. Examples: >
  467. :vimgrep /an error/ *.c
  468. :vimgrep /\<FileName\>/ *.h include/*
  469. :vimgrep /myfunc/ **/*.c
  470. < For the use of "**" see |starstar-wildcard|.
  471. :vim[grep][!] {pattern} {file} ...
  472. Like above, but instead of enclosing the pattern in a
  473. non-ID character use a white-separated pattern. The
  474. pattern must start with an ID character.
  475. Example: >
  476. :vimgrep Error *.c
  477. <
  478. *:lv* *:lvimgrep*
  479. :lv[imgrep][!] /{pattern}/[g][j] {file} ...
  480. :lv[imgrep][!] {pattern} {file} ...
  481. Same as ":vimgrep", except the location list for the
  482. current window is used instead of the quickfix list.
  483. *:vimgrepa* *:vimgrepadd*
  484. :vimgrepa[dd][!] /{pattern}/[g][j] {file} ...
  485. :vimgrepa[dd][!] {pattern} {file} ...
  486. Just like ":vimgrep", but instead of making a new list
  487. of errors the matches are appended to the current
  488. list.
  489. *:lvimgrepa* *:lvimgrepadd*
  490. :lvimgrepa[dd][!] /{pattern}/[g][j] {file} ...
  491. :lvimgrepa[dd][!] {pattern} {file} ...
  492. Same as ":vimgrepadd", except the location list for
  493. the current window is used instead of the quickfix
  494. list.
  495. 5.2 External grep
  496. Vim can interface with "grep" and grep-like programs (such as the GNU
  497. id-utils) in a similar way to its compiler integration (see |:make| above).
  498. [Unix trivia: The name for the Unix "grep" command comes from ":g/re/p", where
  499. "re" stands for Regular Expression.]
  500. *:gr* *:grep*
  501. :gr[ep][!] [arguments] Just like ":make", but use 'grepprg' instead of
  502. 'makeprg' and 'grepformat' instead of 'errorformat'.
  503. When 'grepprg' is "internal" this works like
  504. |:vimgrep|. Note that the pattern needs to be
  505. enclosed in separator characters then.
  506. *:lgr* *:lgrep*
  507. :lgr[ep][!] [arguments] Same as ":grep", except the location list for the
  508. current window is used instead of the quickfix list.
  509. *:grepa* *:grepadd*
  510. :grepa[dd][!] [arguments]
  511. Just like ":grep", but instead of making a new list of
  512. errors the matches are appended to the current list.
  513. Example: >
  514. :call setqflist([])
  515. :bufdo grepadd! something %
  516. < The first command makes a new error list which is
  517. empty. The second command executes "grepadd" for each
  518. listed buffer. Note the use of ! to avoid that
  519. ":grepadd" jumps to the first error, which is not
  520. allowed with |:bufdo|.
  521. An example that uses the argument list and avoids
  522. errors for files without matches: >
  523. :silent argdo try
  524. \ | grepadd! something %
  525. \ | catch /E480:/
  526. \ | endtry"
  527. <
  528. *:lgrepa* *:lgrepadd*
  529. :lgrepa[dd][!] [arguments]
  530. Same as ":grepadd", except the location list for the
  531. current window is used instead of the quickfix list.
  532. 5.3 Setting up external grep
  533. If you have a standard "grep" program installed, the :grep command may work
  534. well with the defaults. The syntax is very similar to the standard command: >
  535. :grep foo *.c
  536. Will search all files with the .c extension for the substring "foo". The
  537. arguments to :grep are passed straight to the "grep" program, so you can use
  538. whatever options your "grep" supports.
  539. By default, :grep invokes grep with the -n option (show file and line
  540. numbers). You can change this with the 'grepprg' option. You will need to set
  541. 'grepprg' if:
  542. a) You are using a program that isn't called "grep"
  543. b) You have to call grep with a full path
  544. c) You want to pass other options automatically (e.g. case insensitive
  545. search.)
  546. Once "grep" has executed, Vim parses the results using the 'grepformat'
  547. option. This option works in the same way as the 'errorformat' option - see
  548. that for details. You may need to change 'grepformat' from the default if
  549. your grep outputs in a non-standard format, or you are using some other
  550. program with a special format.
  551. Once the results are parsed, Vim loads the first file containing a match and
  552. jumps to the appropriate line, in the same way that it jumps to a compiler
  553. error in |quickfix| mode. You can then use the |:cnext|, |:clist|, etc.
  554. commands to see the other matches.
  555. 5.4 Using :grep with id-utils
  556. You can set up :grep to work with the GNU id-utils like this: >
  557. :set grepprg=lid\ -Rgrep\ -s
  558. :set grepformat=%f:%l:%m
  559. then >
  560. :grep (regexp)
  561. works just as you'd expect.
  562. (provided you remembered to mkid first :)
  563. 5.5 Browsing source code with :vimgrep or :grep
  564. Using the stack of error lists that Vim keeps, you can browse your files to
  565. look for functions and the functions they call. For example, suppose that you
  566. have to add an argument to the read_file() function. You enter this command: >
  567. :vimgrep /\<read_file\>/ *.c
  568. You use ":cn" to go along the list of matches and add the argument. At one
  569. place you have to get the new argument from a higher level function msg(), and
  570. need to change that one too. Thus you use: >
  571. :vimgrep /\<msg\>/ *.c
  572. While changing the msg() functions, you find another function that needs to
  573. get the argument from a higher level. You can again use ":vimgrep" to find
  574. these functions. Once you are finished with one function, you can use >
  575. :colder
  576. to go back to the previous one.
  577. This works like browsing a tree: ":vimgrep" goes one level deeper, creating a
  578. list of branches. ":colder" goes back to the previous level. You can mix
  579. this use of ":vimgrep" and "colder" to browse all the locations in a tree-like
  580. way. If you do this consistently, you will find all locations without the
  581. need to write down a "todo" list.
  582. =============================================================================
  583. 6. Selecting a compiler *compiler-select*
  584. *:comp* *:compiler* *E666*
  585. :comp[iler][!] {name} Set options to work with compiler {name}.
  586. Without the "!" options are set for the
  587. current buffer. With "!" global options are
  588. set.
  589. If you use ":compiler foo" in "file.foo" and
  590. then ":compiler! bar" in another buffer, Vim
  591. will keep on using "foo" in "file.foo".
  592. {not available when compiled without the
  593. |+eval| feature}
  594. The Vim plugins in the "compiler" directory will set options to use the
  595. selected compiler. For ":compiler" local options are set, for ":compiler!"
  596. global options.
  597. *current_compiler*
  598. To support older Vim versions, the plugins always use "current_compiler" and
  599. not "b:current_compiler". What the command actually does is the following:
  600. - Delete the "current_compiler" and "b:current_compiler" variables.
  601. - Define the "CompilerSet" user command. With "!" it does ":set", without "!"
  602. it does ":setlocal".
  603. - Execute ":runtime! compiler/{name}.vim". The plugins are expected to set
  604. options with "CompilerSet" and set the "current_compiler" variable to the
  605. name of the compiler.
  606. - Delete the "CompilerSet" user command.
  607. - Set "b:current_compiler" to the value of "current_compiler".
  608. - Without "!" the old value of "current_compiler" is restored.
  609. For writing a compiler plugin, see |write-compiler-plugin|.
  610. GCC *quickfix-gcc* *compiler-gcc*
  611. There's one variable you can set for the GCC compiler:
  612. g:compiler_gcc_ignore_unmatched_lines
  613. Ignore lines that don't match any patterns
  614. defined for GCC. Useful if output from
  615. commands run from make are generating false
  616. positives.
  617. MANX AZTEC C *quickfix-manx* *compiler-manx*
  618. To use Vim with Manx's Aztec C compiler on the Amiga you should do the
  619. following:
  620. - Set the CCEDIT environment variable with the command: >
  621. mset "CCEDIT=vim -q"
  622. - Compile with the -qf option. If the compiler finds any errors, Vim is
  623. started and the cursor is positioned on the first error. The error message
  624. will be displayed on the last line. You can go to other errors with the
  625. commands mentioned above. You can fix the errors and write the file(s).
  626. - If you exit Vim normally the compiler will re-compile the same file. If you
  627. exit with the :cq command, the compiler will terminate. Do this if you
  628. cannot fix the error, or if another file needs to be compiled first.
  629. There are some restrictions to the Quickfix mode on the Amiga. The
  630. compiler only writes the first 25 errors to the errorfile (Manx's
  631. documentation does not say how to get more). If you want to find the others,
  632. you will have to fix a few errors and exit the editor. After recompiling,
  633. up to 25 remaining errors will be found.
  634. If Vim was started from the compiler, the :sh and some :! commands will not
  635. work, because Vim is then running in the same process as the compiler and
  636. stdin (standard input) will not be interactive.
  637. PERL *quickfix-perl* *compiler-perl*
  638. The Perl compiler plugin doesn't actually compile, but invokes Perl's internal
  639. syntax checking feature and parses the output for possible errors so you can
  640. correct them in quick-fix mode.
  641. Warnings are forced regardless of "no warnings" or "$^W = 0" within the file
  642. being checked. To disable this set g:perl_compiler_force_warnings to a zero
  643. value. For example: >
  644. let g:perl_compiler_force_warnings = 0
  645. PYUNIT COMPILER *compiler-pyunit*
  646. This is not actually a compiler, but a unit testing framework for the
  647. Python language. It is included into standard Python distribution
  648. starting from version 2.0. For older versions, you can get it from
  649. http://pyunit.sourceforge.net.
  650. When you run your tests with the help of the framework, possible errors
  651. are parsed by Vim and presented for you in quick-fix mode.
  652. Unfortunately, there is no standard way to run the tests.
  653. The alltests.py script seems to be used quite often, that's all.
  654. Useful values for the 'makeprg' options therefore are:
  655. setlocal makeprg=./alltests.py " Run a testsuite
  656. setlocal makeprg=python % " Run a single testcase
  657. Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
  658. TEX COMPILER *compiler-tex*
  659. Included in the distribution compiler for TeX ($VIMRUNTIME/compiler/tex.vim)
  660. uses make command if possible. If the compiler finds a file named "Makefile"
  661. or "makefile" in the current directory, it supposes that you want to process
  662. your *TeX files with make, and the makefile does the right work. In this case
  663. compiler sets 'errorformat' for *TeX output and leaves 'makeprg' untouched. If
  664. neither "Makefile" nor "makefile" is found, the compiler will not use make.
  665. You can force the compiler to ignore makefiles by defining
  666. b:tex_ignore_makefile or g:tex_ignore_makefile variable (they are checked for
  667. existence only).
  668. If the compiler chose not to use make, it need to choose a right program for
  669. processing your input. If b:tex_flavor or g:tex_flavor (in this precedence)
  670. variable exists, it defines TeX flavor for :make (actually, this is the name
  671. of executed command), and if both variables do not exist, it defaults to
  672. "latex". For example, while editing chapter2.tex \input-ed from mypaper.tex
  673. written in AMS-TeX: >
  674. :let b:tex_flavor = 'amstex'
  675. :compiler tex
  676. < [editing...] >
  677. :make mypaper
  678. Note that you must specify a name of the file to process as an argument (to
  679. process the right file when editing \input-ed or \include-ed file; portable
  680. solution for substituting % for no arguments is welcome). This is not in the
  681. semantics of make, where you specify a target, not source, but you may specify
  682. filename without extension ".tex" and mean this as "make filename.dvi or
  683. filename.pdf or filename.some_result_extension according to compiler".
  684. Note: tex command line syntax is set to usable both for MikTeX (suggestion
  685. by Srinath Avadhanula) and teTeX (checked by Artem Chuprina). Suggestion
  686. from |errorformat-LaTeX| is too complex to keep it working for different
  687. shells and OSes and also does not allow to use other available TeX options,
  688. if any. If your TeX doesn't support "-interaction=nonstopmode", please
  689. report it with different means to express \nonstopmode from the command line.
  690. =============================================================================
  691. 7. The error format *error-file-format*
  692. *errorformat* *E372* *E373* *E374*
  693. *E375* *E376* *E377* *E378*
  694. The 'errorformat' option specifies a list of formats that are recognized. The
  695. first format that matches with an error message is used. You can add several
  696. formats for different messages your compiler produces, or even entries for
  697. multiple compilers. See |efm-entries|.
  698. Each entry in 'errorformat' is a scanf-like string that describes the format.
  699. First, you need to know how scanf works. Look in the documentation of your
  700. C compiler. Below you find the % items that Vim understands. Others are
  701. invalid.
  702. Special characters in 'errorformat' are comma and backslash. See
  703. |efm-entries| for how to deal with them. Note that a literal "%" is matched
  704. by "%%", thus it is not escaped with a backslash.
  705. Note: By default the difference between upper and lowercase is ignored. If
  706. you want to match case, add "\C" to the pattern |/\C|.
  707. Basic items
  708. %f file name (finds a string)
  709. %l line number (finds a number)
  710. %c column number (finds a number representing character
  711. column of the error, (1 <tab> == 1 character column))
  712. %v virtual column number (finds a number representing
  713. screen column of the error (1 <tab> == 8 screen
  714. columns))
  715. %t error type (finds a single character)
  716. %n error number (finds a number)
  717. %m error message (finds a string)
  718. %r matches the "rest" of a single-line file message %O/P/Q
  719. %p pointer line (finds a sequence of '-', '.' or ' ' and
  720. uses the length for the column number)
  721. %*{conv} any scanf non-assignable conversion
  722. %% the single '%' character
  723. %s search text (finds a string)
  724. The "%f" conversion may depend on the current 'isfname' setting. "~/" is
  725. expanded to the home directory and environment variables are expanded.
  726. The "%f" and "%m" conversions have to detect the end of the string. This
  727. normally happens by matching following characters and items. When nothing is
  728. following the rest of the line is matched. If "%f" is followed by a '%' or a
  729. backslash, it will look for a sequence of 'isfname' characters.
  730. On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
  731. when using "%f:". This means that a file name which is a single alphabetical
  732. letter will not be detected.
  733. The "%p" conversion is normally followed by a "^". It's used for compilers
  734. that output a line like: >
  735. ^
  736. or >
  737. ---------^
  738. to indicate the column of the error. This is to be used in a multi-line error
  739. message. See |errorformat-javac| for a useful example.
  740. The "%s" conversion specifies the text to search for to locate the error line.
  741. The text is used as a literal string. The anchors "^" and "$" are added to
  742. the text to locate the error line exactly matching the search text and the
  743. text is prefixed with the "\V" atom to make it "very nomagic". The "%s"
  744. conversion can be used to locate lines without a line number in the error
  745. output. Like the output of the "grep" shell command.
  746. When the pattern is present the line number will not be used.
  747. Changing directory
  748. The following uppercase conversion characters specify the type of special
  749. format strings. At most one of them may be given as a prefix at the begin
  750. of a single comma-separated format pattern.
  751. Some compilers produce messages that consist of directory names that have to
  752. be prepended to each file name read by %f (example: GNU make). The following
  753. codes can be used to scan these directory names; they will be stored in an
  754. internal directory stack. *E379*
  755. %D "enter directory" format string; expects a following
  756. %f that finds the directory name
  757. %X "leave directory" format string; expects following %f
  758. When defining an "enter directory" or "leave directory" format, the "%D" or
  759. "%X" has to be given at the start of that substring. Vim tracks the directory
  760. changes and prepends the current directory to each erroneous file found with a
  761. relative path. See |quickfix-directory-stack| for details, tips and
  762. limitations.
  763. Multi-line messages *errorformat-multi-line*
  764. It is possible to read the output of programs that produce multi-line
  765. messages, i.e. error strings that consume more than one line. Possible
  766. prefixes are:
  767. %E start of a multi-line error message
  768. %W start of a multi-line warning message
  769. %I start of a multi-line informational message
  770. %A start of a multi-line message (unspecified type)
  771. %> for next line start with current pattern again |efm-%>|
  772. %C continuation of a multi-line message
  773. %Z end of a multi-line message
  774. These can be used with '+' and '-', see |efm-ignore| below.
  775. Using "\n" in the pattern won't work to match multi-line messages.
  776. Example: Your compiler happens to write out errors in the following format
  777. (leading line numbers not being part of the actual output):
  778. 1 Error 275 ~
  779. 2 line 42 ~
  780. 3 column 3 ~
  781. 4 ' ' expected after '--' ~
  782. The appropriate error format string has to look like this: >
  783. :set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
  784. And the |:clist| error message generated for this error is:
  785. 1:42 col 3 error 275: ' ' expected after '--'
  786. Another example: Think of a Python interpreter that produces the following
  787. error message (line numbers are not part of the actual output):
  788. 1 ==============================================================
  789. 2 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)
  790. 3 --------------------------------------------------------------
  791. 4 Traceback (most recent call last):
  792. 5 File "unittests/dbfacadeTest.py", line 89, in testFoo
  793. 6 self.assertEquals(34, dtid)
  794. 7 File "/usr/lib/python2.2/unittest.py", line 286, in
  795. 8 failUnlessEqual
  796. 9 raise self.failureException, \
  797. 10 AssertionError: 34 != 33
  798. 11
  799. 12 --------------------------------------------------------------
  800. 13 Ran 27 tests in 0.063s
  801. Say you want |:clist| write the relevant information of this message only,
  802. namely:
  803. 5 unittests/dbfacadeTest.py:89: AssertionError: 34 != 33
  804. Then the error format string could be defined as follows: >
  805. :set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
  806. Note that the %C string is given before the %A here: since the expression
  807. ' %.%#' (which stands for the regular expression ' .*') matches every line
  808. starting with a space, followed by any characters to the end of the line,
  809. it also hides line 7 which would trigger a separate error message otherwise.
  810. Error format strings are always parsed pattern by pattern until the first
  811. match occurs.
  812. *efm-%>*
  813. The %> item can be used to avoid trying patterns that appear earlier in
  814. 'errorformat'. This is useful for patterns that match just about anything.
  815. For example, if the error looks like this:
  816. Error in line 123 of foo.c: ~
  817. unknown variable "i" ~
  818. This can be found with: >
  819. :set efm=xxx,%E%>Error in line %l of %f:,%Z%m
  820. Where "xxx" has a pattern that would also match the second line.
  821. Important: There is no memory of what part of the errorformat matched before;
  822. every line in the error file gets a complete new run through the error format
  823. lines. For example, if one has: >
  824. setlocal efm=aa,bb,cc,dd,ee
  825. Where aa, bb, etc. are error format strings. Each line of the error file will
  826. be matched to the pattern aa, then bb, then cc, etc. Just because cc matched
  827. the previous error line does _not_ mean that dd will be tried first on the
  828. current line, even if cc and dd are multi-line errorformat strings.
  829. Separate file name *errorformat-separate-filename*
  830. These prefixes are useful if the file name is given once and multiple messages
  831. follow that refer to this file name.
  832. %O single-line file message: overread the matched part
  833. %P single-line file message: push file %f onto the stack
  834. %Q single-line file message: pop the last file from stack
  835. Example: Given a compiler that produces the following error logfile (without
  836. leading line numbers):
  837. 1 [a1.tt]
  838. 2 (1,17) error: ';' missing
  839. 3 (21,2) warning: variable 'z' not defined
  840. 4 (67,3) error: end of file found before string ended
  841. 5
  842. 6 [a2.tt]
  843. 7
  844. 8 [a3.tt]
  845. 9 NEW compiler v1.1
  846. 10 (2,2) warning: variable 'x' not defined
  847. 11 (67,3) warning: 's' already defined
  848. This logfile lists several messages for each file enclosed in [...] which are
  849. properly parsed by an error format like this: >
  850. :set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q
  851. A call of |:clist| writes them accordingly with their correct filenames:
  852. 2 a1.tt:1 col 17 error: ';' missing
  853. 3 a1.tt:21 col 2 warning: variable 'z' not defined
  854. 4 a1.tt:67 col 3 error: end of file found before string ended
  855. 8 a3.tt:2 col 2 warning: variable 'x' not defined
  856. 9 a3.tt:67 col 3 warning: 's' already defined
  857. Unlike the other prefixes that all match against whole lines, %P, %Q and %O
  858. can be used to match several patterns in the same line. Thus it is possible
  859. to parse even nested files like in the following line:
  860. {"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}}
  861. The %O then parses over strings that do not contain any push/pop file name
  862. information. See |errorformat-LaTeX| for an extended example.
  863. Ignoring and using whole messages *efm-ignore*
  864. The codes '+' or '-' can be combined with the uppercase codes above; in that
  865. case they have to precede the letter, e.g. '%+A' or '%-G':
  866. %- do not include the matching multi-line in any output
  867. %+ include the whole matching line in the %m error string
  868. One prefix is only useful in combination with '+' or '-', namely %G. It parses
  869. over lines containing general information like compiler version strings or
  870. other headers that can be skipped.
  871. %-G ignore this message
  872. %+G general message
  873. Pattern matching
  874. The scanf()-like "%*[]" notation is supported for backward-compatibility
  875. with previous versions of Vim. However, it is also possible to specify
  876. (nearly) any Vim supported regular expression in format strings.
  877. Since meta characters of the regular expression language can be part of
  878. ordinary matching strings or file names (and therefore internally have to
  879. be escaped), meta symbols have to be written with leading '%':
  880. %\ The single '\' character. Note that this has to be
  881. escaped ("%\\") in ":set errorformat=" definitions.
  882. %. The single '.' character.
  883. %# The single '*'(!) character.
  884. %^ The single '^' character. Note that this is not
  885. useful, the pattern already matches start of line.
  886. %$ The single '$' character. Note that this is not
  887. useful, the pattern already matches end of line.
  888. %[ The single '[' character for a [] character range.
  889. %~ The single '~' character.
  890. When using character classes in expressions (see |/\i| for an overview),
  891. terms containing the "\+" quantifier can be written in the scanf() "%*"
  892. notation. Example: "%\\d%\\+" ("\d\+", "any number") is equivalent to "%*\\d".
  893. Important note: The \(...\) grouping of sub-matches can not be used in format
  894. specifications because it is reserved for internal conversions.
  895. Multiple entries in 'errorformat' *efm-entries*
  896. To be able to detect output from several compilers, several format patterns
  897. may be put in 'errorformat', separated by commas (note: blanks after the comma
  898. are ignored). The first pattern that has a complete match is used. If no
  899. match is found, matching parts from the last one will be used, although the
  900. file name is removed and the error message is set to the whole message. If
  901. there is a pattern that may match output from several compilers (but not in a
  902. right way), put it after one that is more restrictive.
  903. To include a comma in a pattern precede it with a backslash (you have to type
  904. two in a ":set" command). To include a backslash itself give two backslashes
  905. (you have to type four in a ":set" command). You also need to put a backslash
  906. before a space for ":set".
  907. Valid matches *quickfix-valid*
  908. If a line does not completely match one of the entries in 'errorformat', the
  909. whole line is put in the error message and the entry is marked "not valid"
  910. These lines are skipped with the ":cn" and ":cp" commands (unless there is
  911. no valid line at all). You can use ":cl!" to display all the error messages.
  912. If the error format does not contain a file name Vim cannot switch to the
  913. correct file. You will have to do this by hand.
  914. Examples
  915. The format of the file from the Amiga Aztec compiler is:
  916. filename>linenumber:columnnumber:errortype:errornumber:errormessage
  917. filename name of the file in which the error was detected
  918. linenumber line number where the error was detected
  919. columnnumber column number where the error was detected
  920. errortype type of the error, normally a single 'E' or 'W'
  921. errornumber number of the error (for lookup in the manual)
  922. errormessage description of the error
  923. This can be matched with this 'errorformat' entry:
  924. %f>%l:%c:%t:%n:%m
  925. Some examples for C compilers that produce single-line error outputs:
  926. %f:%l:\ %t%*[^0123456789]%n:\ %m for Manx/Aztec C error messages
  927. (scanf() doesn't understand [0-9])
  928. %f\ %l\ %t%*[^0-9]%n:\ %m for SAS C
  929. \"%f\"\\,%*[^0-9]%l:\ %m for generic C compilers
  930. %f:%l:\ %m for GCC
  931. %f:%l:\ %m,%Dgmake[%*\\d]:\ Entering\ directory\ `%f',
  932. %Dgmake[%*\\d]:\ Leaving\ directory\ `%f'
  933. for GCC with gmake (concat the lines!)
  934. %f(%l)\ :\ %*[^:]:\ %m old SCO C compiler (pre-OS5)
  935. %f(%l)\ :\ %t%*[^0-9]%n:\ %m idem, with error type and number
  936. %f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
  937. for GCC, with some extras
  938. Extended examples for the handling of multi-line messages are given below,
  939. see |errorformat-Jikes| and |errorformat-LaTeX|.
  940. Note the backslash in front of a space and double quote. It is required for
  941. the :set command. There are two backslashes in front of a comma, one for the
  942. :set command and one to avoid recognizing the comma as a separator of error
  943. formats.
  944. Filtering messages
  945. If you have a compiler that produces error messages that do not fit in the
  946. format string, you could write a program that translates the error messages
  947. into this format. You can use this program with the ":make" command by
  948. changing the 'makeprg' option. For example: >
  949. :set mp=make\ \\\|&\ error_filter
  950. The backslashes before the pipe character are required to avoid it to be
  951. recognized as a command separator. The backslash before each space is
  952. required for the set command.
  953. =============================================================================
  954. 8. The directory stack *quickfix-directory-stack*
  955. Quickfix maintains a stack for saving all used directories pars

Large files files are truncated, but you can click here to view the full file