崇高的文字:如何向hex_viewer软件包命令添加键绑定 [英] Sublime text: how to add a key binding to hex_viewer package command

查看:55
本文介绍了崇高的文字:如何向hex_viewer软件包命令添加键绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Sublime文本3上安装了Hex Viewer软件包,要对其进行切换,请使用ctrl + shift + p打开命令选项板,然后搜索"hex"并选择该软件包的命令以切换十六进制视图.

I've installed the Hex Viewer package on sublime text 3, to toggle it i use ctrl+shift+p to open the command palette, then i search for "hex" and select the command of the package to toggle the hex view.

我想知道如何将密钥绑定到特定的package命令,我知道密钥绑定配置文件,但是我不知道我应该添加什么JSON行来调用package命令.

I was wondering how to bind a key to the specific package command, I'm aware of the key bindings configuration file but I don't know what JSON line should I add to call the package command.

这是我关于stackoverflow的第一个问题,对不起,如果我做错了事,祝您愉快!

This is my first question on stackoverflow, sorry if I did something wrong, have a nice day!

这是软件包的github: https://github.com/facelessuser/HexViewer 它说:

This is the github of the package: https://github.com/facelessuser/HexViewer It says:

通过命令选项板或按键绑定可以使用10条命令.

There are 10 commands available via the command palette or by key-bindings.

这是我要绑定的那个

十六进制查看器:切换十六进制视图

Hex Viewer: Toggle Hex View

这是我尝试粘贴在键绑定JSON文件上的字符串:

And this is the string I've tried to paste on the key-bindings JSON file:

{"keys":["ctrl+shift+h"] , "command":"Hex Viewer: Toggle Hex View"}

推荐答案

您需要为Hex Viewer键映射添加键绑定.

You need to add a key binding for the Hex Viewer keymap.

为此,在通过Package Control安装Hex Viewer之后,导航到Package Settings -> Hex Viewer -> Key Bindings - Default并添加以下内容:

To do this, after installing Hex Viewer via Package Control, navigate to Package Settings -> Hex Viewer -> Key Bindings - Default and add the following:

[
    {
        "keys": ["ctrl+shift+h"],
        "command": "hex_viewer"
    }
]

要保存文件,您需要确保%APPDATA%\Sublime Text 3\Packages\HexViewer目录存在(假定这是您的软件包目录).

To save the file, you need to ensure that the %APPDATA%\Sublime Text 3\Packages\HexViewer directory exists, assuming this is your package directory.

您提到的GitHub链接上还有一个可用的键映射示例,以及其他可用命令.

There's also an example key map available on the GitHub link you mentioned with the other available commands.

Example.sublime-keymap

[
    {
        "keys": ["ctrl+shift+b","ctrl+shift+h"],
        "command": "hex_viewer"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+i"],
        "command": "hex_show_inspector"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+f"],
        "command": "hex_finder"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+e"],
        "command": "hex_editor"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+x"],
        "command": "hex_writer"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+u"],
        "command": "hex_discard_edits"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+="],
        "command": "hex_checksum",
        "args": {"panel": true}
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+-"],
        "command": "hash_selection"
    },
    {
        "keys": ["ctrl+shift+b","ctrl+shift+g"],
        "command": "hash_eval"
    }
]

这篇关于崇高的文字:如何向hex_viewer软件包命令添加键绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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