为什么这个 Sublime Text 的热键配置不起作用? [英] Why doesn’t this hotkey configuration for Sublime Text work?

查看:32
本文介绍了为什么这个 Sublime Text 的热键配置不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将 Ctrl+B 配置为在我的浏览器中打开一个文件,但是当我在编辑器专注于某个 HTML 页面时按 Ctrl+B 时,它不会不行.为什么不呢?

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?

更多详情:

让我困惑的是,这个ctrl+b如果与close等其他命令结合起来就可以工作,但是为什么openInBrowser命令不行,st2也支持这个命令,怎么知道是否支持这个命令?

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?

编辑 1:

您可以在此链接中找到 openInBrowser 命令http://www.sublimetext.com/docs/commands

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

编辑 2

@MattDMo 那么相应的命令名称是什么,我在其官方文档中找不到它们http://www.sublimetext.com/docs/2/

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

推荐答案

您要查找的命令是 open_in_browser,而不是 openInBrowser(这是一个旧的 Sublime Text 1命令).因此,您的键盘映射应该可以使用.但是,如果您还不知道,CtrlB 已经映射到 Build 命令,用于运行 构建系统.覆盖内置命令并不是一个好主意,尤其是与这个命令一样重要的命令,因此我建议将您的键绑定更改为:

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" }

尽管某些插件可能会使用它,但任何默认的 Sublime 命令都不会使用它.

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

这篇关于为什么这个 Sublime Text 的热键配置不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆