• Stars
    star
    667
  • Rank 67,625 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vim notebook cell bindings for JupyterLab

jupyterlab-vim

Community fork of https://github.com/jwkvam/jupyterlab-vim updated for jupyterlab 2 and 3

Extension status Github Actions Status Binder npm version npm downloads PyPI Conda Version

Notebook cell vim bindings

jlabvim

Modes

Like 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:

  1. Jupyterlab Command Mode
  2. Jupyterlab Edit Mode
    • Insert
    • Normal
    • Visual

Install

pip install jupyterlab-vim

or with conda/mamba:

mamba install -c conda-forge jupyterlab_vim

For Jupyterlab<3 see installing.md.

Key Bindings

To learn how to modify key bindings see the modify-keybinds.md file.

Please note that all keys are lowercase unless Shift is explicitly indicated. For example, Y, Y is two lowercase ys, Shift-Y, Y is one uppercase Y followed by a lowercase y.

Shortcuts this extension introduces:

Vim Ex commands

Command Action
:w[rite] Save Notebook
:q[uit] Enter Jupyter command mode

Vim command bindings

Chord Action
Ctrl-O, U Undo Cell Action
- Split Cell at Cursor
Ctrl-O, - Split Cell at Cursor
Ctrl-O, D Cut Cell
Ctrl-O, Y Copy Cell
Ctrl-O, P Paste Cell
Ctrl-Shift-J Extend Marked Cells Below
Ctrl-Shift-K Extend Marked Cells Above
Ctrl-O, O Insert Cell Below
Ctrl-O, Ctrl-O Insert Cell Above
Ctrl-J Select Cell Below
Ctrl-K Select Cell Above
Ctrl-O, G Select First Cell
Ctrl-O, Ctrl-G Select Last Cell
Ctrl-E Move Cell Down
Ctrl-Y Move Cell Up
Ctrl-O, Z, Z Center Cell
Ctrl-G Show Tooltip
Command/Ctrl-1 Code Cell Mode
Command/Ctrl-2 Markdown Cell Mode
Command/Ctrl-3 Raw Cell Mode
Shift-Escape Leave Vim Mode
Escape, Ctrl-[ Exit Vim Insert Mode

Jupyter command bindings

Chord Action
G, G Select First Cell
Shift-G Select Last Cell
D, D Delete Cell
Y, Y Yank (Copy) Cell
P Paste Cell
Shift-P Paste Cell Above
O Insert Cell
Shift-O Insert Cell Above
U Undo Cell Action
Ctrl-E Move Cells Down
Ctrl-Y Move Cells Up
Z, Z Center Cell
Z, C Hide Code Cell
Z, O Show Code Cell
Z, M Hide All Code Cells
Z, R Show All Code Cells

Special Thanks

From @jwkvam:

I want to acknowledge Alisue and his excellent work creating vim bindings for 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 seen here. When that version was not updated it was updated first by @axelfahy and then moved to this community organization.

Contributing

Contributions and feedback are most welcome!

Development install

Note: You will need NodeJS to build the extension package. To install with conda do:

conda install -c conda-forge nodejs

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_vim directory
# Install package in development mode
pip install jupyter_packaging
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

You 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 needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With 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, the jlpm run build command 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:

jupyter lab build --minimize=False

Uninstall

pip uninstall jupyterlab_vim

More Repositories

1

jupyterlab-variableInspector

Variable Inspector extension for Jupyterlab
TypeScript
1,096
star
2

jupyterlab_code_formatter

A JupyterLab plugin to facilitate invocation of code formatters.
Python
833
star
3

spellchecker

Spellchecker for JupyterLab notebook markdown cells and file editor.
TypeScript
205
star
4

rise

RISE: "Live" Reveal.js JupyterLab Slideshow Extension
TypeScript
167
star
5

jupyterlab-spreadsheet-editor

JupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)
TypeScript
130
star
6

jupyterlab-topbar

JupyterLab Top Bar extensions
TypeScript
106
star
7

jupyterlab-kernelspy

A Jupyter Lab extension for inspecting messages to/from a kernel
TypeScript
81
star
8

jupyterlab-quickopen

Quickly open a file in JupyterLab by typing part of its name
TypeScript
81
star
9

jupyterlab-unfold

An IDE-like file browser for JupyterLab
TypeScript
80
star
10

jupyter-archive

A Jupyter/Jupyterlab extension to make, download and extract archive files.
Python
76
star
11

jupyter-videochat

Video chat with peers inside JupyterLab
TypeScript
60
star
12

jupyterlab-tour

A JupyterLab UI tour built on jupyterlab-tutorial and react-joyride.
TypeScript
59
star
13

jupyterlab-link-share

JupyterLab Extension to easily share a link to a running server on Binder
TypeScript
53
star
14

jupyterlab-contrib.github.io

Management and website of JupyterLab Unofficial Extensions and Tools
Smarty
41
star
15

jupyter-ui-toolkit

UI Toolkit for Jupyter
TypeScript
40
star
16

jupyterlab-cell-flash

JupyterLab extension to show a flash effect when a cell is executed ⚡ ✨
TypeScript
39
star
17

jlab-enhanced-cell-toolbar

A cell toolbar for JupyterLab.
TypeScript
39
star
18

jupyterlab-filesystem-access

[Experimental] Browse local files using the non-standard File System Access API
TypeScript
30
star
19

jlab-enhanced-launcher

Alternative launcher for JupyterLab
TypeScript
25
star
20

jupyterlab-app-cookiecutter

Kickstart your JupyterLab based standalone application 🚀
TypeScript
22
star
21

jupyterlab_toastify

Customize 'react-toastify' to integrate nicely in JupyterLab.
TypeScript
22
star
22

search-replace

Search and replace accross files
TypeScript
21
star
23

jupyterlab-theme-editor

Extension providing a theme editor where colors, font families and font sizes of the elements of the user interface can be varied
TypeScript
21
star
24

jupyterlab-favorites

Add the ability to save favorite folders to JupyterLab for quicker browsing
TypeScript
14
star
25

jupyterlab-open-url-parameter

JupyterLab extension to open files passed via a URL parameter.
TypeScript
10
star
26

jupyterlab-pytutor

Python Tutor extension for JupyterLab
TypeScript
9
star
27

jupyterlab-plugin-graph

JupyterLab extension to show an interactive dependency graph of the installed plugins
TypeScript
9
star
28

jupyterlab-fileopen

A JupyterLab extension that adds a shortcut for opening files using the OS file explorer
Python
7
star
29

jupyterlab-gitlab

A JupyterLab extension for browsing GitLab repositories
TypeScript
5
star
30

ipylgbst

A widget library for controlling LEGO® BOOST via web-bluetooth
Python
4
star
31

jlab-image-editor

Simple image editor for JupyterLab
TypeScript
4
star
32

jupyterlab-logout

Log out button for JupyterLab
Python
3
star
33

jupyterlab-code-toc

Table of Contents JupyterLab extension with code content
TypeScript
3
star
34

react-auth-google-example

Example enabling users to log in with Google Identity service for webapps.
TypeScript
1
star
35

jupyterlab-topbar-text

JupyterLab extension to display arbitrary text in the top bar
Python
1
star
36

.github

Health files for the @jupyterlab-contrib organization
1
star
37

jupyterlab-browser-storage

A JupyterLab Drive to save files in the browser storage.
TypeScript
1
star