tags:

views:

70

answers:

3

I know that when you run :make in vim, you can use commands to go through each error like :cn and :cp. However, I often find myself scrolling through warnings that I don't need to fix. Is there a way to quit scrolling through the errors/warnings and resume editing? (I have heard that you can set Vim to ignore warnings, but I've been told it's difficult so I'm looking for something easier).

+1  A: 

You can close the quickfix window by running:

:ccl[ose]

If you want to open the quickfix window again (without having to run :make) you can run:

:cope[n]

Even if the quickfix window is not visible, you can still move forwards and backwards through the items in it with the commands :cn and :cp.

Personally, I find the :cn and :cp commands quite laborious to type, so I would recommend mapping them to something more convenient if you use them often. The unimpaired plugin provides sensible mappings for moving through the quickfix list:

[q   :cprevious
]q   :cnext
[Q   :cfirst
]Q   :clast
nelstrom
+1  A: 

I often find myself scrolling through warnings that I don't need to fix

Two solutions:

  • The very very best solution: Set your compiler to the highest warning level and change your code to get rid of all warnings.

  • The very very worst solution: Set 'errorformat' so that warnings do not hit. See :help errorformat. How to do this is specific to your compiler output format.

Is there a way to quit scrolling through the errors/warnings and resume editing?

Hmmm, maybe I get your question wrong but I would do it this way: Open at least two windows. One shows the erros/warnings (quickfix window) and the other shows your code. Just change focus from quickfix to code window in order to continue typing code.

Habi
A: 

If quitting from that window is all you want you can do as suggested above

:ccl

or even simply

:q

in the errors window. Or you can simply switch windows ctrl-w+w ctrl-w+k...

skeept