Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

vim - open a file under cursor in a split window

I often jump from a file to file, while working a large codebase. I typically do this by way of putting cursor on the file, say foo.h, and typing "gf". I wonder if I can do the same thing, yet open the file in a split window.

One obvious solution is to simply type: vsp (sp) filename.

question from:https://stackoverflow.com/questions/2433833/open-a-file-under-cursor-in-a-split-window

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

<c-w>gf open in a new tab (Ctrl-w gf)

<c-w>f for split window <-- this is the answer you are seeking (Ctrl-w f)

source: http://vim.wikia.com/wiki/Open_file_under_cursor


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...