Question

I have configured Ctrl+B to open a file in my browser, but when I press Ctrl+B when the editor is focused on some HTML page, it doesn’t work. Why not?

more details:

what makes me confused is that this ctrl+b works if it is combined to other command such as close, but why not openInBrowser command, so does st2 support this command, how to know whether it support this command or not?

Edit 1:

you may find openInBrowser command in this link http://www.sublimetext.com/docs/commands

Edit 2

@MattDMo what is the corresponding name of command then, i cannot find them in its official document http://www.sublimetext.com/docs/2/

Was it helpful?

Solution

The command you are looking for is open_in_browser, not openInBrowser (which is an old Sublime Text 1 command). So, your keymapping should work with that. However, if you weren't already aware, CtrlB is already mapped to the Build command, used for running build systems. It's not a very good idea to overwrite built-in commands, especially one as important as this one, so I'd suggest changing your keybinding to:

{ "keys": ["ctrl+alt+b"], "command": "open_in_browser" }

This isn't in use by any of the default Sublime commands, although some plugins may use it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top