我正在使用python模式的python工作正常,但是我真的很烦恼默认情况下运行执行命令下的命令每当我按CTRL + ENTER,因为我不断意外按下它。 如何禁用此行为? 我试过了
(global-set-key (kbd "<C-return>") nil)但这似乎没有效果。 任何帮助深表感谢。
I am using python with elpy mode which work fine, however I am really annoyed by the default which runs executes the command under the cursor whenever I press CTRL+ENTER since I keep pressing it accidentally. How do I disable this behavior? I tried
(global-set-key (kbd "<C-return>") nil)but that does not seem to have an effect. Any help is much appreciated.
最满意答案
它可能没有在全局键映射中设置,而是在主模式的映射或某些次模式的映射中。 在具有键绑定的缓冲区中,执行Ch k C-<return>以查看绑定; 它应该显示它所在的键映射。然后使用define-key进行更改。 例如,如果foo-mode-map包含绑定,请执行
(define-key foo-mode-map (kbd "C-<return>") nil)您可能希望将该代码添加到挂钩或with-eval-after-load将其包装,因此在运行时定义foo-mode-map 。
It's probably not set in the global key map, but in the major mode's map or some minor mode's map. In a buffer with the key bound, do C-h k C-<return> to see the binding; it should show the key map that it's in. Then use define-key to change it. E.g. if foo-mode-map contains the binding, do
(define-key foo-mode-map (kbd "C-<return>") nil)You will probably want to add that code to either a hook or wrap it in with-eval-after-load, so foo-mode-map is defined when it runs.
更多推荐
发布评论