Sublime Forum

Why the heck is the build system on by default and hotkeyed to ctrl-b?

#1

So, I accidentally pressed ctrl-b instead of ctrl-v, and now my typescript project is junked up with tons of useless js files that I didn’t ask for. This is terrible functionality, definitely shouldn’t be on be default, and most definitely shouldn’t be hotkeyed to something that’s easily pressed by accident, considering it’s such an annoying action. Anything that’s potentially destructive or that requires a user to do a lot of things shouldn’t be on by default, or should at least require a confirmation before running. This is very frustrating to be working, and now have to stop and go clean up all this junk that sublime generated.

How do I disable the build system permanently?

2 Likes

#2

If you want to remove the default key bindings having to do with build systems, you can select Preferences > Key Bindings from the menu and then add one or more of the following bindings to the right hand pane between the [] characters:

	{ "keys": ["f7"], "command": "build" },
	{ "keys": ["ctrl+b"], "command": "build" },
	{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"select": true} },
	{ "keys": ["ctrl+break"], "command": "cancel_build" },

In all cases, replace the command build or cancel_build with the command noop to disable that key binding.

I would recommend adding a comment (// line comment) above the bindings to explain what you did and why so that in the future you’ll know why you did it.

0 Likes

#3

That works, thanks for the help.

0 Likes

#4

Thanks, I also used those keybindings to disable the build hotkeys after I accidentally pressed Ctrl-B. And I agree with @frodo2975, I think it’s a dangerous default feature that while editing code, an accidental keypress (next to Ctrl-V) will suddenly run the code. I was even editing code over a network share, and that code was intended to run later on the remote server, not on my PC.

0 Likes

#5

I can sort of understand that this can happen, although in all the 6 or so years of using ST I can’t seem to remember accidentally pressing ctrl+b once. The binding is quite idiomatic and changing it would certainly do more harm than good. Besides, what would you even change it to? “b” for build is an easy call.

0 Likes

#6

Disastrously misplaced keybinding.

Did you mean to ctrl+v–one of the most commonly used commands ever–or did you want me to exec this here shell script?

Or maybe you just wanted a new tab/window ctrl+n?
Nah, definitely YOLO build.

I can sort of understand that this can happen , although in all the 6 or so years of using ST I can’t seem to remember accidentally pressing ctrl+b once .

:brain:

The binding is quite idiomatic and changing it would certainly do more harm than good.

Would it?

Besides, what would you even change it to?

["ctrl+alt+b"], ["ctrl+b", "ctrl+d"], etc… :wink:

For real human beans:

[
    { "keys": ["f7"], "command": "noop" },
    { "keys": ["ctrl+b"], "command": "noop" },
    { "keys": ["ctrl+shift+b"], "command": "noop", "args": {"select": true} },
    { "keys": ["ctrl+break"], "command": "noop" },
]
0 Likes