In Vim, I often find myself in a situation where I want to complete a filename of a file that I'm editing in a separate buffer.
Suppose I have two buffers open: foo.cpp and bar.h. In foo.cpp I need to #include "bar.h". I want to do something like this:
foo.cpp
#include "b<complete filename to bar.h>
According to Vim documentation, I am able to use CTRL+x CTRL+f to do filename completion, but that seems to rely on Vim having a CWD equivalent to bar.h's parent directory. That's not always possible.
Given that I have bar.h open in a separate buffer, is it possible to autocomplete based on buffer name?