for example, if I have something like this:
#include "filename.h"
when I select filename.h I want to use it as the input for opening the file named filename.h in a split. thanks in advance for any help.
for example, if I have something like this:
#include "filename.h"
when I select filename.h I want to use it as the input for opening the file named filename.h in a split. thanks in advance for any help.
Place your cursor on the file name and press gf
in normal mode.
:help gf
You might want to tweak the 'path'
option for a list of directories where the file can be found.
:help 'path'
I believe you want a ctrl+wctrl+f. Press these keys with the cursor over the filename.
If you want this in a vertical split, and as a command, you can run :vertical wincmd f
with your cursor over the word.
You can shorten this to :vert winc f
or even nnoremap gf :vert winc f<cr>
if you so choose.