To a limited degree you can change what commands get executed in response to mouse clicks (or wheel scrolls) by using a sublime-mousemap
file. This is more limited than a key binding because unlike key bindings, there is no concept of a context
you can apply to have different combinations apply at different times.
For example, an appropriately named file (see below) with the following contents will make a control+click
execute the goto_definition
command. This would do what you want, although you have to do a normal click once to put the cursor into the word before you control+click
because the goto_definition
command jumps to the definition of the symbol at the cursor position and not the mouse position (though it should be possible to create a plugin that moves the cursor and then executes the command to make things a bit more seamless):
[
{
"button": "button1", "count": 1, "modifiers": ["ctrl"],
"press_command": "goto_definition",
},
]
The downside of this is that this mouse and key combination together already has a function (add a new cursor at the click location), so by doing this you lose the ability to do that.
If you want to go this way, you want to create a file in your User
package (use Preferences > Browse Packages...
if you’re not sure where that is) named Default (<PLATFORM>).sublime-mousemap
; replace <PLATFORM>
with one of Linux
, Windows
or OSX
depending on what platform you’re on.