Jupyter笔记本alt + D快捷键碰撞

时间:2016-09-13 21:32:14

标签: ipython jupyter jupyter-notebook

我想尝试使用Jupyter笔记本电脑,但由于我的键盘布局使用alt+dalt+f来插入(),因此我很快就遇到了问题。 39;工作。我的所有其他修饰符也基于alt+{letter}并且它们都有效,但出于某种原因alt+dalt+f被某些东西吞噬了。但是,我无法找到这两种组合的任何快捷方式。

我已将以下内容添加到~/.ipython/profile_default/static/custom/custom.js

$([IPython.events]).on("app_initialized.NotebookApp", function () {
    // No idea what these do, but the mess with my keyboard layout
    IPython.keyboard_manager.command_shortcuts.remove_shortcut("Alt-d");
    IPython.keyboard_manager.command_shortcuts.remove_shortcut("Alt-f");
});

但即使在服务器重启和浏览器重新加载后,这似乎也没有任何效果。

由于

1 个答案:

答案 0 :(得分:0)

因此经过一定程度的挖掘后,我发现了导致这种情况的原因。问题不在jupyter笔记本中,而是由底层CodeMirror编辑器中的快捷方式引起的。如图所示here CodeMirror为Alt + d和Alt + e添加了快捷方式。禁用这些的方法是在~/.jupyter/custom/custom.js

中添加以下内容
delete CodeMirror.keyMap.emacsy["Alt-F"]; 
delete CodeMirror.keyMap.emacsy["Alt-D"];
相关问题