In vim, how do I choose which window to load a quickfix item?

Take a look at QFEnter vim plugin. It opens a item in the 'wincmd p' window when hitting enter or double-clicking on the quickfix item. Actually, it's my plugin :)


set switchbuf+=uselast

if you want to load the quickfix item into the previously used window.


From :help quickfix.txt:

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 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. If the buffer in the used window has changed, and the error is in another file, jumping to the error will fail. You will first have to make sure the window contains a buffer which can be abandoned.

I don't think you'll be able to avoid creating a custom mapping.