Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Concept

Alisue edited this page Feb 17, 2016 · 2 revisions

This extension is desiged to provide a Vim like environment in Jupyter notebook. The basic concept of the extension is:

Allow most of Jupyter manipulation in Vim mode to stay in Vim mode as long as possible and do complex manipulation of Jupyter in Jupyter mode

To achieve this concept, key mappings provided by Jupyter in default are overwritten by the extension as:

  • Enter Vim mode; a super mode of Command mode and Insert mode; by 1) Double clicking a cell, 2) Hit <Enter> on a cell, or 3) Hit i on a cell
  • Leave Vim mode and re-enter Jupyter mode by hitting <S-Esc> (Shift-Escape), uncomfortable mapping on purpose
  • Enter Insert mode or leave Insert mode as like Vim (i, a, etc.)
  • Jupyter manipulation is 1) Allowed in Jupyter mode, 2) Partially allowed in Command mode, 3) Disallowed in Insert mode
  • Misc mappings in Command mode is restricted except the followings
    • <S-Enter> to run cell and select a cell below
    • <A-Enter> to run cell and insert a cell below
    • <C-Enter> to run cell and leave from Vim mode
    • <C-S-Enter> to run all cells
    • <C-1>, <C-2>, or <C-3> to change a cell mode to code, markdown, or raw
    • <C-S-p> to open a command pallet
    • etc.
  • Repeat mappings in Command mode is prefixed with <C- (Ctrl) or <C-S- (Ctrl-Shift) like:
    • <C-j>/<C-k> to select a cell below/above
    • <C-S-j>/<C-S-k> to extend selected cells below/above
    • <C-y>/<C-e> to scroll up/down
    • <C-S-u>/<C-S-d> to scroll notebook up/down
    • etc.
  • One-time mappings in Command mode is prefixed with <C-o> (Ctrl-o) like:
    • <C-o>gg to select a first cell
    • <C-o>G to select a last cell
    • <C-o>o/<C-o>O to insert cell below/above
    • <C-o>p/<C-o>P to paste cell below/above
    • <C-o>yy/<C-o>dd to yank/delete the current cell
    • <C-o>zm/<C-o>zr to collapse/expand output
    • <C-o>zt/<C-o>zz to scroll the current cell to the top/center
    • etc.

Users can see what key mappings are available with the extension by hitting <F1> in both Jupyter mode or Vim mode

Clone this wiki locally