如题
VScode官方提供了Jupyter的插件,拥有go to next/previous cell的快捷键设置,分别为ctrl+alt+]
和ctrl+alt+[
。尤其在使用VIM插件的情况下,这两个快捷键会经常被用到,这样就避免了手摸鼠标的不便。但是这两个快捷键仿佛不是很灵光。在这里提供一个解决办法。
在File->Preferences->Keyboard Shortcuts里面搜索next cell,会出来五个选项,前四个分别为:
将这四个的Keybinding都改为ctrl+alt+]
,然后注意到这四个里面后面三个快捷键设置中有一个的when语句是:
“when”: “editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == ‘Normal’ && notebookEditorCursorAtBoundary != ‘none’ && notebookEditorCursorAtBoundary != ‘top’”
修改这个语句为
“when”: “notebookEditorFocused && vim.mode == ‘Normal’”
便可以了。
previous cell的情况是类似的,只要修改一个条件就可以了。在搜索previous cell的时候有可能只出来四个快捷键,比next cell的情况少一个,只需要将前三个的keybinding改成ctrl+alt+[
并把中间两个快捷键的其中一个when语句与上面情况相似的改成上面那样的when语句便可。