Home Download Buy Blog Forum Support

Open file under cursor

Open file under cursor

Postby jbjornson on Mon Sep 05, 2011 10:15 am

I created a plugin from the idea posted by Marco Sordi on UserEcho.
Often a file contains the name of a second file, and you would like to open the second file.
Like "gf" command on Vim

The plugin will look for a file name in the following places (and in the following order):
  • the cursor expanded to enclosing quotes (both single and double quotes should work)
  • the selected text
  • the whole line
  • 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.

https://gist.github.com/1186126
jbjornson
 
Posts: 353
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Open file under cursor

Postby jbrooksuk on Mon Sep 05, 2011 3:07 pm

Finally a better attempt than mine!
jbrooksuk
 
Posts: 782
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Open file under cursor

Postby Suor on Mon Nov 07, 2011 8:57 am

A simpler version, just opens file at cursor
https://gist.github.com/1344471
Suor
 
Posts: 9
Joined: Wed Oct 19, 2011 3:09 pm

Re: Open file under cursor

Postby tito on Mon Nov 07, 2011 5:40 pm

There is plugin https://github.com/SublimeText/Open-Include
Which does that. If you found more exceptions to add ( cases where included file can be opened )

There are very welcome there.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 877
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 10 guests