如何从命令面板/热键设置 sublime 中的标尺? [英] How can I set the ruler in sublime from the command palette/hotkey?

查看:31
本文介绍了如何从命令面板/热键设置 sublime 中的标尺?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过点击View ->标尺 ->80 但从命令面板或热键(除了alt,右,右,右,右,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向下,向右,向下,向下,向下,输入).

I can do this by clicking View -> Ruler -> 80 but it'd be a lot more convient to do it from the command palette or a hotkey (apart from alt, right, right, right, right, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, down, right, down, down, down, enter).

虽然我找到了一种方法来创建一个文件来添加命令面板选项,但我知道如何使它适用于任意数字,理想情况下输入 set rule 33 将标尺设置为 33,set rule 44 66 将在 44 和 66 处设置标尺.我只知道如何通过为每个标尺明确命令来做到这一点价值,而不是对所有人来说都是动态的.

Though I found a way to make a file to add command palette options, I do not know how to make it work for arbitrary numbers, ideally typing set ruler 33 would set the ruler to 33 and set ruler 44 66 would make a ruler at 44 and 66. I only know how to do it by making an explicit command for each value rather than a dynamic one for all of them.

推荐答案

一旦你将菜单栏聚焦,你通常可以点击菜单的第一个字母来打开它(V for View 在这种情况下),然后是您希望打开或选择的任何子菜单或选项的第一个字母.在以前的 Windows 版本中(我还没有使用过 Win10),有一个选项,通常默认设置为在菜单项的热键"下划线,如果您有两个以相同的菜单项开头的菜单项,这将特别有用信.如果没有下划线,我假设您可以开始拼写菜单项,因此如果您有 ViewVerify 在同一个子菜单上,您只需输入 vi 作为第一个和 ve 用于第二个.

Once you have the menu bar focused, you can generally hit the first letter of a menu to open it (V for View in this case), then the first letter of any submenus or options you wish to open or select, respectively. In previous versions of Windows (I haven't used Win10 yet) there was an option, usually set by default, to underline the "hotkey" of the menu item, which is especially useful if you have two menu items that begin with the same letter. If nothing is underlined, I would assume you can just start spelling out the menu item, so if you have View and Verify on the same submenu, you'd just type vi for the first and ve for the second one.

因此,对于您的特定设置,只需按 Alt 以聚焦菜单栏,然后​​按 VR8 用于 视图 ->标尺 ->80,分别.

So, for your particular setup, just hit Alt to focus the menu bar, then V, R, 8 for View -> Ruler -> 80, respectively.

作为免费赠品,我会给你的不是一个而是两个键盘快捷键:

As a freebie, I'll give you not one but two keyboard shortcuts as well:

{ 
    "keys": ["ctrl+shift+8"], 
    "command": "set_setting", 
    "args": 
    {
        "setting": "rulers", 
        "value": [80]
    } 
},
{ 
    "keys": ["ctrl+shift+0"], 
    "command": "set_setting", 
    "args": 
    {
        "setting": "rulers", 
        "value": []
    } 
}

将这些添加到您的用户键盘映射中,CtrlShift8 会将标尺设置为 80,而 CtrlShift0 会将它们设置回无.请记住,这仅适用于当前视图,并非所有打开的文件,任何新打开的文件或视图将默认恢复为您的项目、用户设置或默认设置(按此顺序)中的值.

Add these to your user keymap, and CtrlShift8 will set the rulers to 80, while CtrlShift0 will set them back to none. Remember that this is for the current view only, not all open files, and any newly-opened files or views will default back to the value in either your project, user settings, or default settings (in that order).

这篇关于如何从命令面板/热键设置 sublime 中的标尺?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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