tags:

views:

31

answers:

1

When I compile or run a file from VIM all error references are opened in the last active buffer regardless if the file is open already in another vim tab. This behavior is very annoying.

Is there any way to force vim to behave like ':tab drop' on compile errors? (See http://vim.wikia.com/wiki/Edit_a_file_or_jump_to_it_if_already_open)

Thanks a lot for any hints!

+1  A: 

You're looking for the 'switchbuf' option. If you set switchbuf=useopen,usetab,newtab, then any window/tab that is already displaying the buffer with the error will be focused. If there isn't a window/tab displaying the buffer, then a new tab will be created in which to display it.

jamessan
Thanks! Exactly what I searched for.
Peter