Why doesn’t this hotkey configuration for Sublime Text work?

删除回忆录丶 提交于 2019-12-24 10:39:42

问题


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/


回答1:


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.



来源:https://stackoverflow.com/questions/24029242/why-doesn-t-this-hotkey-configuration-for-sublime-text-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!