Package: jupyterlab-vim
jupyterlab-vimCommunity fork ofhttps://github.com/jwkvam/jupyterlab-vimupdated for jupyterlab 2, 3 and 4Notebook cell vim bindingsModesLike vim, Jupyterlab has a distinction between edit mode and command mode. Jupyterlab Command mode is when the cursor is not in a specific cell, and edit mode when typing in a cell.This extension combines the Jupyterlab (Edit and Command) modes with the standard vim modes (Normal, Insert, Visual). So the set of modes now looks like:Jupyterlab Command ModeJupyterlab Edit ModeInsertNormalVisualInstallpipinstalljupyterlab-vimor with conda/mamba:mambainstall-cconda-forgejupyterlab_vimKey BindingsTo learn how to modify key bindings see themodify-keybinds.mdfile.Please note that all keys are lowercase unlessShiftis explicitly indicated.For example,Y, Yis two lowercaseys,Shift-Y, Yis one uppercaseYfollowed by a lowercasey.Shortcuts this extension introduces:Vim Ex commandsCommandAction:w[rite]Save Notebook:q[uit]Enter Jupyter command modeVim command bindingsChordActionCtrl-O, UUndo Cell Action-Split Cell at CursorCtrl-O, -Split Cell at CursorCtrl-O, DCut CellCtrl-O, YCopy CellCtrl-O, PPaste CellCtrl-Shift-JExtend Marked Cells BelowCtrl-Shift-KExtend Marked Cells AboveCtrl-O, OInsert Cell BelowCtrl-O, Ctrl-OInsert Cell AboveCtrl-JSelect Cell BelowCtrl-KSelect Cell AboveCtrl-O, GSelect First CellCtrl-O, Ctrl-GSelect Last CellCtrl-EMove Cell DownCtrl-YMove Cell UpCtrl-O, Z, ZCenter CellCtrl-GShow TooltipCommand/Ctrl-1Code Cell ModeCommand/Ctrl-2Markdown Cell ModeCommand/Ctrl-3Raw Cell ModeShift-EscapeLeave Vim ModeEscape, Ctrl-[Exit Vim Insert ModeJupyter command bindingsChordActionG, GSelect First CellShift-GSelect Last CellD, DDelete CellY, YYank (Copy) CellPPaste CellShift-PPaste Cell AboveOInsert CellShift-OInsert Cell AboveUUndo Cell ActionCtrl-EMove Cells DownCtrl-YMove Cells UpZ, ZCenter CellZ, CHide Code CellZ, OShow Code CellZ, MHide All Code CellsZ, RShow All Code CellsSpecial ThanksFrom @jwkvam:I want to acknowledgeAlisueand his excellent work creatingvim bindingsfor Jupyter notebooks.
I hope this extension can meet the high bar his work set.@jkwvam is the original author of this extension - the original version can be seenhere. When that version was not updated it was updated first by @axelfahy and then moved to this community organization.ContributingContributions and feedback are most welcome!Development installNote: You will need NodeJS to build the extension package. To install withcondado:conda install -c conda-forge nodejsThejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab_vim directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm run buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseUninstallpipuninstalljupyterlab_vim