Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run :make from vim and there's an error, it opens that file on the error line number in the current buffer. If possible, I would prefer it switch tabs to the file if it's already open, or make a new tab with the error file. Is this possible?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can work with a quickfix window:

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. 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 instead.

(from Vim's quickfix.txt, Section 2)

Just type

:help quickfix-window

in vim to get there.

For example

:copen

opens a quickfix window.

share|improve this answer
    
I looked a quickfix before posting this, but your instructions make it clearer. It's probably the way to go, thanks. –  Peter Zich Apr 29 '12 at 1:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.