我刚开始使用 jupyter notebook。谷歌搜索没有帮助。谢谢!
更新:答案的快速摘要
在启动 ipython 文件之前在单元格中运行以下代码为我完成了任务。一个问题是我们必须每次都为每个文件运行它。
%%javascript
// 将设置应用到所有当前 CodeMirror 实例
IPython.notebook.get_cells().map(
function(c) { return c.code_mirror.options.indentWithTabs=true; }
);
// 确保将来创建的新 CodeMirror 实例也使用此设置
CodeMirror.defaults.indentWithTabs=true;