Open file under cursor

Marco Sordi 9 ár síðan updated by Marco Sordi 9 ár síðan 4

Often a file contains the name of a second file, and you would like to open the second file.
Like "gf" command on Vim

Thanks in advance


Here is a plugin that I created for this.  You will have add a key mapping for it though.


Totally awesome, Thank you!

It would be great if it could do the following steps:
1) Select text under the cursor between single or double quotes
2) Resolve the path and open the file

| = cursor position

<link href="css/xam|pp.css" rel="stylesheet" type="text/css">

Open the file "xampp.css" inside "css" folder

Thanks Again!


I updated the plugin with the functionality requested by Marco Sordi. 

The plugin will look for a file name in the following places (and in the following order):

  1. the cursor expanded to enclosing quotes (both single and double quotes should work)
  2. the selected text
  3. the whole line
  4. the clipboard text

If no filename can be found, the plugin will try to create a new file from the selected text.

Both relative and absolute paths should work.


I also posted something on the forum, so any enhancement requests or other discussions should maybe go there:


Wonderful plugin. Thank you!