« Fletcher to coach England in cup | Main | Format C: Yes Yes »

February 01, 2007

Opening files from inside vi

Like most vi-fanatics, I have always known about :split but someone asked me if it was possible to open a file when the name of the file was in the file you were editing.

Confused?

Imagine you are editing the file "foo" and it contains something like:
The really useful data is in the file bar, not in the file foo...

If you place the cursor over the word bar and type gf then vi will open the file bar in the current buffer. Pretty neat hey!

Of course, if you want to keep the current file open and also open the new file, use :split first.

Posted by Ozguru at February 1, 2007 06:00 AM

Comments

This post has attracted 20 spam comments so further comments are now blocked.

Posted by: SpamBuster at February 2, 2007 09:50 PM