ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Open-Include

by titoBouzout ST2/ST3 Removed

Will open file paths found under the cursor with ALT+D

Details

  • 2016.03.18.06.51.07
  • github.​com
  • github.​com
  • 2 years ago
  • 2 years ago
  • 6 years ago

Installs

  • Total 12K
  • Win 6K
  • OS X 3K
  • Linux 2K
Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1
Windows 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Description

This plugin will try to open Sublime Text file paths found on caret positions or partial selections when pressing ALT+D. It has support for custom prefixes and subfixes. Usefull when doing require style JavaScript modules when no extension specified.

Strings starting with HTTP will open with default browser (if binary, ie ends with png), if not, we will read the file with urllib and open the result in a new view/tab. By setting the "open_http_in_browser" setting in your user preferences to true, we will always open the default browser.

use_strict preference will control if the path should be complete and correct, if not the file will not open and the package will not attempt to find the source file.

In theory this package should work like this:

  • If in “Find Results” panel, current file and line number position
  • The exact selection(s)
  • Text between quotes under caret positions.
  • Selections expanded to full lines covered by caret positions or partial selections.
  • Current lines split by (){}[]'"
  • Current lines split by spaces or tabs
  • Current word
  • If nothing works, will check the Full text up to 10485760

Resolving:

Will try to resolve to:

  • Absolute path to URL (e.g. https?://...)
  • Relative to current view
  • Relative to current view minus 1 folder
  • Relative to current view minus 2 folders
  • Relative to project folders
  • Relative to project folders minus 1 folder
  • Relative to project folders minus 2 folders
  • Absolute path

If everything else fails will also look into:

  • Relative to the folder of all opened views
  • Relative to all sub-folders
  • Relative to all parent folders

Reporting an error somewhere

Please, To report an error provide the following information:

  1. Project path (ex: c:/www/website)
  2. Opened file path (ex: c:/www/website/index.html)
  3. Included file line code (ex: a href="../html/views/home/Content/base/t16.shtml" ….
  4. Exact location of included file, in t16.shtml (ex c:/www/website/views/home/Content/base/t16.shtml)
  5. The setting file of this package

notes

create_if_not_exists

  1. create if not exists work only in scope “parameter.url, string.quoted”

Installation

Download or clone the contents of this repository to a folder named exactly as the package name into the Packages/ folder of ST.

Contributors: