Question

i've installed the tern-js plugin for sublime 3, however for some reason I cannot make its command work with sublime's key bindings (I'm a sublime nube btw) according to the documentation.. ternjs_jump_to_definition is supposed to be a valid command.

So i put this in the default (OSX).sublime-keymap file:

{ "keys": ["super+ctrl+j"], "command": "ternjs_jump_to_definition"},
{ "keys": ["super+ctrl+r"], "command": "ternjs_reload"},

I also put this.. still didn't work:

{ "keys": ["super+ctrl+j"], "command": "ternjs_jump_to_definition", "context":
    [
            { "key": "has_next_field", "operator": "equal", "operand": true }
    ]
}

any idea what's going on wrong? I know that tern-js is installed.. because typing Ctrl+Space for code completion actually works:

any idea what I'm doing wrong? I simply want typing command+ctrl+j to jump to method definition.

Also I looked at the default sublime 3 jump to method definition (ie alt+command+down), and it only works on the same file even if i add libraries to the project. (I'm using mapbox, which works on top of leaflet).

enter image description here

No correct solution

OTHER TIPS

Wow, this is an old question! I just ran into this myself (Sublime Text version 2.0.2), and I tried "ctrl+right" as my key binding. It didn't work. My guess was because it was in the Default/Default (OSX).sublime-keymap file. So, I searched for some key sequences to use, and discovered "ctrl+z" was available, and tried that.

The following is what I added to User/Default (OSX).sublime-keymap file:

[
    { "keys": ["ctrl+z"], "command": "ternjs_jump_to_definition", "args": {"to": "line" } }
]

It only brought me to the top of the source file until I added the "args" parameter as shown. Now it takes me right to the function signature! The above is the entire contents of my User keymap settings, by the way.

I looked in my default keymap file, and I didn't find super+ctrl+j nor super+ctrl+r in the file, even with super and ctrl swapped, so I'm not sure what else I can suggest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top