Last Updated: February 25, 2016
·
1.793K
· noahblon

Soft Undo with Mouse Key in Sublime Text 3 OSX

I love multiple cursors in Sublime. I recently found out how you can undo your last action when making multiple selections by hitting Cmd+U, but I don't like switching back to the keyboard from my mouse, so I've mapped the command to a mousekey.

These instructions are for Sublime Text 3 on OSX but Im sure you could make it work on Windows and Sublime Text 2 as well.


Create a file called Default(OSX).sublime-mousemap in ~/Library/Application Support/Sublime Text 3/Packages/User. Add the following to the file:

[ 
    { "button": "button3", "modifiers": ["super"], "command": "soft_undo"  }
]

Now when multiple selecting, if you screw up, click the middle mouse key with Command (super) still held to undo instead of having to switch back to the keyboard. You can set the button to be whatever you want but for my mouse config this is perfect.