Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click go to definition #52

Open
arnsa opened this issue May 12, 2018 · 4 comments
Open

Click go to definition #52

arnsa opened this issue May 12, 2018 · 4 comments

Comments

@arnsa
Copy link

arnsa commented May 12, 2018

Is it possible to somehow add a shortcut (e.g. ctrl+click) to go to definition? The default one from Sublime doesn't work. :(

@pichillilorenzo
Copy link
Owner

To add a custom key binding go to Preferences > Key Bindings and add your keys.
For example:

[
  {
    "keys": ["super+alt+g"], // This is the default key binding for Go to definition feature!
    "command": "javascript_enhancements_go_to_definition"
  }
]

Here the docs: http://docs.sublimetext.info/en/latest/reference/key_bindings.html

@arnsa
Copy link
Author

arnsa commented May 12, 2018

@pichillilorenzo but what about ctrl+click? I've tried to set it up like this in Default (OSX).sublime-mousemap file, but it doesn't work :(

[ { "button": "button1", "count": 1, "modifiers": ["ctrl"], "press_command": "drag_select", "command": "javascript_enhancements_go_to_definition" } ]

@helsus
Copy link

helsus commented Jul 13, 2018

@arnsa works for me:

[
     {
      "button": "button1",
      "count": 1,
      "modifiers": ["super"], // "super" is cmd button. "ctrl" also works fine
      "press_command": "drag_select",
      "command": "javascript_enhancements_go_to_definition",
      "context": [
           { "key": "selector", "operator": "equal", "operand": "source.js, source.jsx" }
      ]
   }
]

@arnsa
Copy link
Author

arnsa commented Aug 9, 2018

@helsus thanks, it didn't work with super (probably because cmd+click adds new cursor on sublime, but it worked with ctrl! It doesn't open a file when I click on an import :(, any ideas why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants