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

Hyper​Click

by aziz ST3

Quickly and easily jump between your files. The missing part of Go to definition functionality in Sublime.

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

Sublime HyperClick

Quickly and easily jump between your files. The missing part of Go to definition functionality in Sublime.

sublime hyperclick

Most of the time when you are navigating and reading a code-base, you need to jump between required/imported (whatever jargon your programming language uses) files. Go to Definition functionality of Sublime, trying to be a generic solution, falls short for most languages since jumping between these required files needs some knowledge about how the language or package manager of the language is working.

HyperClick tries to solve this issue. Currently, it knows how to jump between files in Javascript, Sass, Less, Stylus and PHP but can be easily extended to support more languages.

Supported Languages and Syntaxes

Language Syntax
Javascript ecmascript.sublime-syntax
JavaScript.sublime-syntax
JavaScript (Babel).sublime-syntax
JavaScriptNext.tmLanguage
Sass SCSS.tmLanguage
Sass.tmLanguage
Less LESS.tmLanguage
Stylus Stylus.tmLanguage
PHP PHP.sublime-syntax
PHP Source.sublime-syntax

You can contribute and add more languages by adding a path resolver like SassPathResolver

Installation

You can install HyperClick via Sublime Package Control

Or clone this repo into your SublimeText Packages directory and rename it to HyperClick

Usage

HyperClick gives you four different ways to navigate, that you can choose based on your preference.

1. Phantoms on hover (Sublime >= 3118)

If you are using the most recent build of sublime, you can just hover over the required line and an arrow button will appear at the end of line that you can click and navigate to the destination file. See gif animation file above.

2. Phantoms on cursor line (Sublime >= 3118)

Having your cursor on a required/imported line will also show the navigation button just like hovering over the line.

3. Context Menu

If you right click on a required/imported line you'll get a Jump To Source File ➜ menu item on the context menu.

sublimehyperclickcontext

4. Shortcut key

By default, HyperClick is using F12 (sublime's default Go to definition) shortcut. This does not override the default functionality since it's only using it in contexts that Sublime's self Go to definition can not help you navigate. You can still customize the shortcut by adding this code to your own key-binding settings.

{
    "keys": ["f12"],
    "command": "hyper_click_jump",
    "context": [{ "key": "hyper_click_jump_line", "operand": true }]
}

Settings

You can customize HyperClick settings by going to Preferences > Package Settings > HyperClick > Settings

Disable Annotations (phantom arrow button)

If you don't like the arrow button, you can disable them by setting annotations_enabled to false

Change Annotations contents

HyperClick uses a greenish button with when it finds the destination file and a reddish button with . These symbols can be customized too.

{
  "annotation_found_text": "➜",
  "annotation_not_found_text": "✘"
}

Default Settings

see hyper_click.sublime-settings for up to date settings

{
  "supported_syntaxes": {
    "js": [
      "ecmascript.sublime-syntax",
      "JavaScript.sublime-syntax",
      "JavaScript (Babel).sublime-syntax",
      "JavaScriptNext.tmLanguage"
    ],
    "sass": [
      "SCSS.tmLanguage",
      "Sass.tmLanguage"
    ]
  },
  "import_line_regex": {
    "js": [
      "^import\\s+.+\\s+from\\s+['\"](.+)['\"];?$",
      "^import\\s+['\"](.+)['\"];?$",
      ".+require\\(['\"](.+)['\"]\\).+"
    ],
    "sass": [
      "^@import\\s+['\"](.+)['\"];?$"
    ]
  },
  "valid_extensions": {
    "js": ["js", "jsx"],
    "sass": ["scss", "sass"]
  },
  "default_filenames": {
    "js": ["index"]
  },
  "vendor_dirs": {
    "js": ["node_modules"]
  },
  "annotation_found_text": "➜",
  "annotation_not_found_text": "✘",
  "annotations_enabled": true
}

License

Copyright 2016-2017 Allen Bargi. Licensed under the MIT License