Vim Tips Wiki
(Insert TipProposed template + minor manual clean)
(Change <tt> to <code>, perhaps also minor tweak.)
Line 30: Line 30:
 
I fail to see any reason why one would use :make at all, if one wasn't interested in using quickfix. Can you enlighten me? Without the quickfix list, you get no feedback in Vim about the :make results.
 
I fail to see any reason why one would use :make at all, if one wasn't interested in using quickfix. Can you enlighten me? Without the quickfix list, you get no feedback in Vim about the :make results.
   
For your immediate problem, just add a '!'. I.e., instead of <tt>:make</tt>, type <tt>:make!</tt>. This suppresses the automatic jump to the first error.
+
For your immediate problem, just add a '!'. I.e., instead of <code>:make</code>, type <code>:make!</code>. This suppresses the automatic jump to the first error.
   
 
For vimgrep, etc., there are other ways to avoid the jump.
 
For vimgrep, etc., there are other ways to avoid the jump.
   
A couple commands don't let you avoid the jump. The cscope commands don't have an option to avoid the jump, and neither does <tt>:cfile</tt>. However, a much better solution to deleting the quickfix list, would be to simply jump back to where you were. I think there's an ex command to do it, but failing that, just an :execute "normal! \<C-O>" should do the trick. --[[User:Fritzophrenic|Fritzophrenic]] 17:54, November 17, 2011 (UTC)
+
A couple commands don't let you avoid the jump. The cscope commands don't have an option to avoid the jump, and neither does <code>:cfile</code>. However, a much better solution to deleting the quickfix list, would be to simply jump back to where you were. I think there's an ex command to do it, but failing that, just an :execute "normal! \<C-O>" should do the trick. --[[User:Fritzophrenic|Fritzophrenic]] 17:54, November 17, 2011 (UTC)
   
 
:One case where it is really annoying is with the location-list (similar to quickfix window). If you include a file via \input, it will pop up to tell you that you included a file! It gets '''really''' annoying when you have 2 split windows, each with location-list windows, and it looks like you are editing from the other side of a mail box slit. If you close the window, it reappears after you save it. [[User:Pukster|Pukster]] 11:33, February 17, 2012 (UTC)
 
:One case where it is really annoying is with the location-list (similar to quickfix window). If you include a file via \input, it will pop up to tell you that you included a file! It gets '''really''' annoying when you have 2 split windows, each with location-list windows, and it looks like you are editing from the other side of a mail box slit. If you close the window, it reappears after you save it. [[User:Pukster|Pukster]] 11:33, February 17, 2012 (UTC)

Revision as of 08:20, 14 July 2012

Proposed tip Please edit this page to improve it, or add your comments below (do not use the discussion page).

Please use new tips to discuss whether this page should be a permanent tip, or whether it should be merged to an existing tip.
created November 17, 2011 · complexity basic · version 7.0

One of my largest annoyances with Vim is the great Quickfix, in particular the auto-jump. The reasons for this do not matter, but I wanted to disable it really bad. It took me several months to figure out how to do it, and the end-result still feels like a hack.

The code for this

Put the following in your vimrc:

autocmd QuickFixCmpPost * call setqflist([])

What this does is quite inhumane: it deletes the quickfix-list. I am still looking for a way to disable the `jump' without deleting the list.

Use case

Obviously, quickfix is a sacred thing, and should never be disabled. To figure out why I would still want to, read the following.

I use Vim to edit TeX-files, and want to know about boxing errors (underfull, overfull) so that I can fix those. In very few cases, however, I can not fix it, because I am quoting an exercise from a book for my homework. But, everytime I type ':make', it jumps to the boxing error, and I lost where I am.

Comments

I fail to see any reason why one would use :make at all, if one wasn't interested in using quickfix. Can you enlighten me? Without the quickfix list, you get no feedback in Vim about the :make results.

For your immediate problem, just add a '!'. I.e., instead of :make, type :make!. This suppresses the automatic jump to the first error.

For vimgrep, etc., there are other ways to avoid the jump.

A couple commands don't let you avoid the jump. The cscope commands don't have an option to avoid the jump, and neither does :cfile. However, a much better solution to deleting the quickfix list, would be to simply jump back to where you were. I think there's an ex command to do it, but failing that, just an :execute "normal! \<C-O>" should do the trick. --Fritzophrenic 17:54, November 17, 2011 (UTC)

One case where it is really annoying is with the location-list (similar to quickfix window). If you include a file via \input, it will pop up to tell you that you included a file! It gets really annoying when you have 2 split windows, each with location-list windows, and it looks like you are editing from the other side of a mail box slit. If you close the window, it reappears after you save it. Pukster 11:33, February 17, 2012 (UTC)
If the quickfix list is automatically appearing whenever you save a file, that means you have a plugin which automatically runs :make followed by :copen or similar on a save. Check the plugin's documentation to see if there is a way to disable it, or edit the plugin to remove the automatic :copen, or and/or add a '!' to the :make command as suggested. --Fritzophrenic 16:55, February 17, 2012 (UTC)