如何诊断和修复 Sublime Text 3 中的键绑定冲突 [英] How to diagnose and fix a key-binding conflict in Sublime Text 3

查看:38
本文介绍了如何诊断和修复 Sublime Text 3 中的键绑定冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用于粘贴的默认键绑定

{ "keys": ["ctrl+v"], "command": "paste" },
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },

我在我的用户键绑定中覆盖了它们

I overrode them in my user key-bindings with

{ "keys": ["alt+k"], "command": "paste" },
{ "keys": ["ctrl+k"], "command": "paste_and_indent" },

我使用Dvorak 键盘,这意味着你的 V我的 K.另外,我希望 paste_and_indent 成为默认值.

I use Dvorak keyboard, which means your V is my K. Also, I want paste_and_indent to be the default.

但是Ctrl+k 执行paste,而不是paste_and_indent.我通过在控制台中打开命令日志来确定这一点,使用

But Ctrl+k executes paste, not paste_and_indent. I determined this by turning on command logging in the console, with

sublime.log_commands(True)

但是,如果我将 paste_and_indent 命令设为其他内容,例如 Ctrl+Alt+kAlt+k,正确调用paste_and_indent.

However, if I make the paste_and_indent command to something else, like Ctrl+Alt+k or Alt+k, it correctly calls paste_and_indent.

我查看了所有已安装软件包的键绑定,但没有看到任何其他使用 Ctrl+k 的命令.除了语法之外,我还禁用了大部分软件包.我什至不小心禁用了包控制,但是,Ctrl+k 只执行paste.

I looked through the key-bindings for all of my installed packages, and don't see any other command using Ctrl+k. I also disabled most of my packages except syntaxes. I even accidentally disabled Package Control, but still, Ctrl+k only executes paste.

如何确定并修复此冲突,以便 Ctrl+k 执行 paste_and_indent?

How can I determine and fix this conflict, so Ctrl+k executes paste_and_indent?

推荐答案

查看FindKeyConflicts插件.在各种上下文中,有多种选项可用于查看所有键绑定或仅冲突的键绑定.所有选项均可通过命令面板使用.

Check out the FindKeyConflicts plugin. There are several options for looking at all key bindings, or just conflicting ones, in a variety of contexts. All the options are available via the Command Palette.

这篇关于如何诊断和修复 Sublime Text 3 中的键绑定冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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