Sublime Forum

Can I remove an override in a package (i.e. restore default)

#1

I can see there are many ways to override built-in behaviors. But what happens if a package adds an override that I don’t want? I’m thinking specifically of SublimeJedi, which steals ctrl+button1, which has the very important built-in behavior of adding a selection. Obviously, I can edit the package’s Default.sublime-mousemap and remove the offending override, but then I have to do this every time the package updates. Seems like I need to write my own Default.sublime-mousemap in Packages/User to override the override. What should it say? I can’t find any documentation for mousemap. And ST3 lets me view the default keymap, but not the default mousemap.

(It occurs to me that this particular case might be a bug in SublimeJedi. The mousemap I’m referring to reads

{ "modifiers": "ctrl"], "button": "button1", "command": "sublime_jedi_goto", "press_command": "drag_select" }
which seems like it might be trying to say what to do about drag selections, but it’s not saying it right?)

0 Likes

#2

Yes you can likely override the file (as it’s supported in ST3), but creating a “Default ().sublime-mousemap” is probably a better solution. You can see the default values in the Default folder. To view the defaults, without having to manually extract, take a look at PackageResourceViewer.

0 Likes

#3

Thanks. Creating my own sublime-mousemap does solve this particular problem. (The defaults, by the way, are in C:\Program Files\Sublime Text 3\Packages\Default.sublime-package in ST3.)

Still, it would be nice if mousemap and keymap files had some sort of magic value, say “use-default-behavior”: true, to remove any package overrides.

0 Likes