写在前面
没改之前的jupyter简直把我劝退,简直丑爆了!!
对于强迫症的我来说不改简直不能用,于是找了很多教程,改了主题,但是字体丑爆了,而且太小了,写了一点代码,我简直想把电脑摔了!!!还不如我原来的sublime呢,后来我终于遇到人生中救我一命的一串代码,各位大侠拿去!!干死这个丑爆的jupyter!!
- 主题美化
# 先装主题包
pip install jupyterthemes -i https://pypi.tuna.tsinghua.edu.cn/simple
# 修改主题并设置主题字体等
jt -t oceans16 -f fira -fs 13 -cellw 90% -ofs 11 -dfs 11 -T
- 自动提示,再也不用按tab了
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable
点击并勾选Hinteriand,即可开启代码提示功能
3. 导入sublime快捷方式
在C://users/xx/.jupyter/custom/custom.js这个文件中添加下面这段代码,刷新jupyter页面,就可以使用sublime的快捷键。
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"],
function(sublime_keymap, cell, IPython) {
cell.Cell.options_default.cm_config.keyMap = 'sublime';
var cells = IPython.notebook.get_cells();
for(var cl=0; cl< cells.length ; cl++){
cells[cl].code_mirror.setOption('keyMap', 'sublime');
}
}
);
经过实验,“Ctrl-Enter”: “insertLineAfter”,似乎然并软?
效果如下
参考文章: