上一篇文章 介绍了 jupyter-notebook
怎样 map
。jupyterlab
是新一代的 jupyter-notebook,
有点像R-Studio
, 有更多的功能了。
# For jupyterlab 2.0
jupyter-labextension install @axlair/jupyterlab_vim
# vimrc
jupyter-labextension install jupyterlab-vimrc
"nmap": [
["n","j"],
["e","k"]
],
jupyterlab
pip install --user jupyterlab
# or
conda activate
conda install jupyterlab
# jupyterlab 1.0
jupyter labextension install jupyterlab_vim
# jupyterlab 2.0
jupyter-labextension install @axlair/jupyterlab_vim
jupyter-labextension install jupyterlab-vimrc
{
// vimrc
// jupyterlab-vimrc:vimrc
// Settings to be applied to codemirror vim mode
// *********************************************
// imap commands
// [lhs, rhs] - e.g. "imap": [["ii", ""]]
"imap": [
],
// inoremap commands
// [lhs, rhs]
"inoremap": [
[]
],
// nmap commands
// [lhs, rhs]
"nmap": [
["n","j"],
["e","k"]
],
// nnoremap commands
// [lhs, rhs]
"nnoremap": [
["i","l"],
["m","n"],
["k","m"],
["f","e"],
["t","f"],
["l","u"],
["u","i"],
["N","J"],
["E","K"],
["I","L"],
["M","N"],
["K","M"],
["F","E"],
["T","F"],
["L","U"],
["U","I"],
["\'","'"]
],
// vmap commands
// [lhs, rhs]
"vmap": [
],
// vnoremap commands
// [lhs, rhs]
"vnoremap": [
["n","j"],
["e","k"],
["i","l"],
["k","n"],
["f","e"],
["t","f"],
["l","u"],
["u","i"],
["N","J"],
["E","K"],
["I","L"],
["K","N"],
["F","E"],
["T","F"],
["L","U"],
["U","I"],
["\'",":"]
]
}
其中需要注意的是
"nmap": [
["n","j"],
["e","k"]
],
可能是因为 jupyterlab_vim
, 会涉及到cell之间的跳转,所以需要使用nmap