6

Does anybody know if it's possible to bind the middle mouse button to an action in Sublime Text 2?

I know that some mouse interaction is possible, because you can use the back and forward buttons.

Basically, I was going to use this button to upload a file with the sFTP plugin so it would decrease the amount of buttons I would need to press from 3 to 1.

Currently, I have:

{ "keys": ["ctrl+shift+u"], "command": "sftp_upload_file" }

Ideally it would be something like this:

{ "keys": ["mouse4"], "command": "sftp_upload_file" }
pleshy
  • 1,350
  • 2
  • 14
  • 22

3 Answers3

12

You can look at the mouse mappings by opening Packages/Default/Default (operating system).sublime-mousemap. You can then change what you want and save it in Packages/User.

MattDMo
  • 90,104
  • 20
  • 213
  • 210
  • 1
    I was putting the binds in the keyboard bind file not the mouse file thank you. – pleshy Jun 06 '13 at 15:41
  • 2
    Where can I find the 'Packages/Default/Default (operating system).sublime-mousemap'? Is it a path? Or is it a click path on the menu? I am using Mac and Sublime 3. I don't see anything on the menu that looks similar to this. Please help. – Believe2014 Apr 30 '15 at 13:48
5

I figured it out thanks to @MattDMo pointer.

I created a file in

Packages\User\Default (Windows).sublime-mousemap

inside the file I placed

[ 
    { "button": "button3", "modifiers": [], "command": "sftp_upload_file" }
]
pleshy
  • 1,350
  • 2
  • 14
  • 22
0

For Sublime portable version (Windows)

Place the mousemap file in SublimeText\Data\Packages\User folder to get it to work, where SublimeText is the portable version directory.

vineel
  • 2,765
  • 2
  • 23
  • 26