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 1K
  • Win 382
  • OS X 775
  • Linux 207
Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8
Windows 0 0 4 3 4 1 4 0 0 0 1 4 5 1 0 0 1 0 1 0 1 0 1 2 0 2 0 0 0 3 1 3 1 1 2 0 1 2 2 0 0 1 1 1 2 2
OS X 2 1 1 0 6 3 1 1 4 0 2 2 1 6 2 1 5 4 6 6 2 1 2 3 4 0 6 2 2 0 4 1 4 5 2 1 1 2 0 3 1 3 0 0 0 0
Linux 0 0 0 0 2 1 0 0 0 2 3 3 0 1 1 1 1 0 2 1 3 2 0 1 1 0 0 2 0 1 0 3 0 0 0 1 1 1 1 1 1 0 0 0 1 4

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