tags:

views:

62

answers:

2

If I have a file that contains a complete path for a file, is there a way to highlight the filename (using visual mode) and open the file? (preferably in a split screen)

As I think about it, here is what I would like: if the file name contains a / character, assume it is a full path (IE the 'current directory' is root). Otherwise, use the current folder (IE default behavior) Is this possible?

+4  A: 

Put the cursor on the filename and type gf (in command mode). Or use CTRL-W CTRL-F to open in another window. See also :help gf (no, it's not your girlfriend).

catchmeifyoutry
Thanks! (stupid extra characters rules...)
David Oneill
You can of course `:sp` first so it opens in a new split
hasen j
+1  A: 

gf command opens file under cursor.

Grzegorz Gierlik
Thanks! (stupid extra characters rules...)
David Oneill