Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jupyterlab-contrib/jupyterlab-vim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.1.2
Choose a base ref
...
head repository: jupyterlab-contrib/jupyterlab-vim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 8 commits
  • 11 files changed
  • 5 contributors

Commits on Feb 8, 2024

  1. Fix scrolling on g g and G (#137)

    * Fix scrolling on `g g` and `G`
    
    * Ensure cell is focused after scrolling
    
    Co-authored-by: ianhi <ianhi@users.noreply.github.com>
    
    * Lint
    
    ---------
    
    Co-authored-by: ianhi <ianhi@users.noreply.github.com>
    krassowski and ianhi authored Feb 8, 2024
    Copy the full SHA
    7aa48c1 View commit details
  2. Publish 4.1.3

    SHA256 hashes:
    
    axlair-jupyterlab_vim-4.1.3.tgz: 61486c84f40a7078576e592fa0365558abd81a3cd6734d0e4bceef482c7ad90e
    
    jupyterlab_vim-4.1.3-py3-none-any.whl: a0c74c9697f42f42d030133f5b3aea092ef9c8dc7d8252afb91cdad951677131
    
    jupyterlab_vim-4.1.3.tar.gz: 57e1a0a4eddd2334e8d7a7c0df80f5097b78f5480ffa84307f2e508df98b6878
    ianhi committed Feb 8, 2024
    Copy the full SHA
    b0a90a9 View commit details

Commits on Sep 12, 2024

  1. Update codemirror-vim to 6.2.1 and jupyterlab to 4.2.0 (#146)

    * Bump CM and JL packages to match JL 4.2.0
    
    * Bump cm-vim version
    
    * Regenerate lock file
    
    * Add guards for possible null value in cm.state.vim introduced by codemirror-vim
    firai authored Sep 12, 2024
    Copy the full SHA
    8812da6 View commit details

Commits on Sep 16, 2024

  1. Update release workflows (#147)

    * Update prep-release.yml
    
    * Update publish-release.yml
    krassowski authored Sep 16, 2024
    Copy the full SHA
    e2d73f4 View commit details
  2. Publish 4.1.4

    SHA256 hashes:
    
    axlair-jupyterlab_vim-4.1.4.tgz: 320f647fd32292bb7ab048bb5c8d65a2826d679791549d27398f0f21611f6e79
    
    jupyterlab_vim-4.1.4-py3-none-any.whl: 13c29ff1fd385fddf33eb85a8b16441be69c62032870bb97a3054b2cf00ab135
    
    jupyterlab_vim-4.1.4.tar.gz: abf2891aafb32f0cb94ad98321ae7ebcbe0cabe523d38d80d569c0a50b85225a
    krassowski committed Sep 16, 2024
    Copy the full SHA
    c791891 View commit details

Commits on Nov 15, 2024

  1. README - transition between modes (#127)

    * README - transition between modes
    
    * README code style
    
    * README lint
    
    * Reorganize new mode switching section and add link in mode description section
    
    * Lint
    
    * Change to <kbd> tags to address review comment
    
    ---------
    
    Co-authored-by: firai <firai.admin@gmail.com>
    BAlmeidaS and firai authored Nov 15, 2024
    Copy the full SHA
    c08147b View commit details

Commits on Nov 25, 2024

  1. Readme cleanup (#154)

    * Initial cleanup
    
    * Lint
    
    * Abbreviate `cmd`, revise "change cell type" binding description to follow JL and revise `Shift` description
    
    * Reorder key bindings so that corresponding Edit mode and Command mode bindings are in the same order
    
    * More fixes
    firai authored Nov 25, 2024
    Copy the full SHA
    9b44041 View commit details

Commits on Apr 18, 2025

  1. Update Github actions checkout, upload-artifact and `download-art…

    …ifact` to v4 and `setup-python` to v5 (#158)
    firai authored Apr 18, 2025
    Copy the full SHA
    8fddaed View commit details
Showing with 2,484 additions and 1,968 deletions.
  1. +5 −5 .github/workflows/build.yml
  2. +2 −2 .github/workflows/check-release.yml
  3. +4 −1 .github/workflows/prep-release.yml
  4. +10 −9 .github/workflows/publish-release.yml
  5. +31 −2 CHANGELOG.md
  6. +75 −58 README.md
  7. +14 −15 package.json
  8. +2 −2 pyproject.toml
  9. +4 −0 src/codemirrorCommands.ts
  10. +12 −11 src/labCommands.ts
  11. +2,325 −1,863 yarn.lock
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -44,7 +44,7 @@ jobs:
pip uninstall -y "jupyterlab_vim" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/jupyterlab_vim*
@@ -56,11 +56,11 @@ jobs:

steps:
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install and Test
@@ -84,6 +84,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
4 changes: 2 additions & 2 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install Dependencies
@@ -22,7 +22,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jupyterlab_vim-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
5 changes: 4 additions & 1 deletion .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
@@ -22,16 +22,19 @@ on:
jobs:
prep_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Prep Release
id: prep-release
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
version_spec: ${{ github.event.inputs.version_spec }}
post_version_spec: ${{ github.event.inputs.post_version_spec }}
target: ${{ github.event.inputs.target }}
branch: ${{ github.event.inputs.branch }}
since: ${{ github.event.inputs.since }}
since_last_stable: ${{ github.event.inputs.since_last_stable }}
19 changes: 10 additions & 9 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -15,33 +15,34 @@ on:
jobs:
publish_release:
runs-on: ubuntu-latest
environment: release
permissions:
# This is useful if you want to use PyPI trusted publisher
# and NPM provenance
id-token: write
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Populate Release
id: populate-release
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
token: ${{ steps.app-token.outputs.token }}
branch: ${{ github.event.inputs.branch }}
release_url: ${{ github.event.inputs.release_url }}
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}

- name: Finalize Release
id: finalize-release
env:
# The following are needed if you use legacy PyPI set up
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
# TWINE_USERNAME: __token__
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
token: ${{ steps.app-token.outputs.token }}
release_url: ${{ steps.populate-release.outputs.release_url }}

- name: "** Next Step **"
33 changes: 31 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,37 @@

<!-- <START NEW CHANGELOG ENTRY> -->

## 4.1.4

([Full Changelog](https://github.com/jupyterlab-contrib/jupyterlab-vim/compare/v4.1.3...e2d73f4ee2bee0999c6aee8667158b8c888bff12))

### Maintenance and upkeep improvements

- Update release workflows [#147](https://github.com/jupyterlab-contrib/jupyterlab-vim/pull/147) ([@krassowski](https://github.com/krassowski))
- Update `codemirror-vim` to 6.2.1 and `jupyterlab` to 4.2.0 [#146](https://github.com/jupyterlab-contrib/jupyterlab-vim/pull/146) ([@firai](https://github.com/firai))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyterlab-contrib/jupyterlab-vim/graphs/contributors?from=2024-02-08&to=2024-09-16&type=c))

[@firai](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Afirai+updated%3A2024-02-08..2024-09-16&type=Issues) | [@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Agithub-actions+updated%3A2024-02-08..2024-09-16&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Akrassowski+updated%3A2024-02-08..2024-09-16&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 4.1.3

([Full Changelog](https://github.com/jupyterlab-contrib/jupyterlab-vim/compare/v4.1.2...7aa48c117212dd4eb7b5a828735d514265b7b4c9))

### Bugs fixed

- Fix scrolling on `g g` and `G` [#137](https://github.com/jupyterlab-contrib/jupyterlab-vim/pull/137) ([@krassowski](https://github.com/krassowski))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyterlab-contrib/jupyterlab-vim/graphs/contributors?from=2024-02-07&to=2024-02-08&type=c))

[@krassowski](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Akrassowski+updated%3A2024-02-07..2024-02-08&type=Issues)

## 4.1.2

([Full Changelog](https://github.com/jupyterlab-contrib/jupyterlab-vim/compare/v4.1.1...5ed87b6c38fda4d0129ea18a43d137c60d286a9e))
@@ -17,8 +48,6 @@

[@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Agithub-actions+updated%3A2024-02-07..2024-02-07&type=Issues) | [@ianhi](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Aianhi+updated%3A2024-02-07..2024-02-07&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-vim+involves%3Akrassowski+updated%3A2024-02-07..2024-02-07&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 4.1.1

This is the last release to support jupyterlab `< 4.1` The next release will include: https://github.com/jupyterlab-contrib/jupyterlab-vim/pull/135
133 changes: 75 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,16 +16,18 @@ Notebook cell vim bindings

## 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.
Like vim, Jupyterlab has a distinction between Edit mode and Command mode. Jupyterlab is in Command mode when the cursor is not in a specific cell, and it is in 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:
This extension combines the Jupyterlab (Edit and Command) modes with the standard vim modes (Normal, Insert and Visual). So the set of modes now looks like:

1. Jupyterlab Command Mode
2. Jupyterlab Edit Mode
- Insert
1. Jupyterlab Command mode
2. Jupyterlab Edit mode
- Normal
- Insert
- Visual

See [key bindings for switching between modes](#switching-between-modes).

## Install

```bash
@@ -42,66 +44,81 @@ mamba install -c conda-forge jupyterlab_vim

To learn how to modify key bindings see the [modify-keybinds.md](modify-keybinds.md) file.

**Please note that all keys are lowercase unless `Shift` is explicitly indicated.**
For example, `Y, Y` is two lowercase `y`s, `Shift-Y, Y` is one uppercase `Y` followed by a lowercase `y`.
**Please note that all keys are lowercase unless <kbd>Shift</kbd> is explicitly indicated.**
For example, "<kbd>Y</kbd>, <kbd>Y</kbd>" means pressing lowercase <kbd>y</kbd> twice, while "<kbd>Shift-Y</kbd>, <kbd>Y</kbd>" means pressing <kbd>Shift</kbd>+<kbd>y</kbd> followed by a lowercase <kbd>y</kbd>.

Shortcuts this extension introduces:
Shortcuts that 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 |
| :q[uit] | Enter Jupyter Command Mode |

### Vim (Jupyter Edit mode) bindings

| Shortcut | Action |
| -------------- | ------------------------- |
| - | Split Cell at Cursor |
| Ctrl-O, - | Split Cell at Cursor |
| Ctrl-Shift-J | Extend Marked Cells Below |
| Ctrl-Shift-K | Extend Marked Cells 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-O, O | Insert Cell Below |
| Ctrl-O, Ctrl-O | Insert Cell Above |
| Ctrl-O, D | Delete (Cut) Cell |
| Ctrl-O, Y | Yank (Copy) Cell |
| Ctrl-O, P | Paste Cell Below |
| Ctrl-E | Move Cell Down |
| Ctrl-Y | Move Cell Up |
| Ctrl-O, U | Undo Cell Action |
| Ctrl-O, Z, Z | Center Cell |
| Ctrl-G | Show Tooltip |
| Cmd/Ctrl-1 | Change to Code Cell |
| Cmd/Ctrl-2 | Change to Markdown Cell |
| Cmd/Ctrl-3 | Change to Raw Cell |
| Shift-Esc | Exit to Command Mode |
| Esc or Ctrl-\[ | Exit Current Mode |

### Jupyter Command mode bindings

| Shortcut | Action |
| -------- | ------------------- |
| G, G | Select First Cell |
| Shift-G | Select Last Cell |
| O | Insert Cell Below |
| Shift-O | Insert Cell Above |
| D, D | Delete (Cut) Cell |
| Y, Y | Yank (Copy) Cell |
| P | Paste Cell Below |
| Shift-P | Paste Cell Above |
| Ctrl-E | Move Cells Down |
| Ctrl-Y | Move Cells Up |
| U | Undo Cell Action |
| 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 |

### Switching between modes

- From Command mode:
- To enter Normal mode from Command mode, press <kbd>Enter</kbd>.
- The extension blocks <kbd>Shift</kbd>+<kbd>Esc</kbd> from invoking browser commands, such as the browser task manager, by default. To disable the blocking behavior in Command mode, go to Settings menu → Settings Editor → Notebook Vim, and disable the "Override `Shift-Esc` browser shortcut in Jupyter Command mode" option.
- From Normal mode:
- To leave Normal mode to Command mode, several options are available:
- <kbd>Shift</kbd>+<kbd>Esc</kbd>
- <kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>[</kbd>, if the "Enable `Esc` and `Ctrl-[` leaving vim Normal mode to Jupyter Command mode" option is enabled (on by default). To disable the option, go to Settings menu → Settings Editor → Notebook Vim.
- To enter Insert mode from Normal mode, use one of the insert commmands, such as <kbd>i</kbd>, <kbd>Shift</kbd>+<kbd>i</kbd>, <kbd>a</kbd>, <kbd>Shift</kbd>+<kbd>a</kbd>, <kbd>o</kbd>, <kbd>Shift</kbd>+<kbd>o</kbd>, <kbd>c</kbd>, <kbd>Shift</kbd>+<kbd>c</kbd>, <kbd>s</kbd> or <kbd>Shift</kbd>+<kbd>s</kbd>.
- To enter Visual mode from Normal mode, use one of the visual commands, such as <kbd>v</kbd>, <kbd>Shift</kbd>+<kbd>v</kbd> or <kbd>Ctrl</kbd>+<kbd>v</kbd>.
- From Insert or Visual mode:
- To leave Insert or Visual mode to Normal mode, press <kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>[</kbd>.
- To leave Insert or Visual mode to Command mode, press <kbd>Shift</kbd>+<kbd>Esc</kbd>.

## Special Thanks

29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axlair/jupyterlab_vim",
"version": "4.1.2",
"version": "4.1.4",
"description": "Code cell vim bindings",
"author": {
"name": "Axel Fahy"
@@ -56,26 +56,25 @@
"style/index.js"
],
"dependencies": {
"@codemirror/state": "^6.2.1",
"@codemirror/view": "^6.15.3",
"@jupyterlab/application": "^4.0.3",
"@jupyterlab/cells": "^4.0.3",
"@jupyterlab/codemirror": "^4.0.3",
"@jupyterlab/fileeditor": "^4.0.3",
"@jupyterlab/notebook": "^4.0.3",
"@jupyterlab/settingregistry": "^4.0.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.26.0",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/cells": "^4.2.0",
"@jupyterlab/codemirror": "^4.2.0",
"@jupyterlab/fileeditor": "^4.2.0",
"@jupyterlab/notebook": "^4.2.0",
"@jupyterlab/settingregistry": "^4.2.0",
"@lumino/commands": "^2.0.1",
"@lumino/coreutils": "^2.0.0",
"@lumino/disposable": "^2.1.2",
"@lumino/domutils": "^2.0.0",
"@replit/codemirror-vim": "^6.0.14",
"@replit/codemirror-vim": "^6.2.1",
"react": "^18.2.0"
},
"devDependencies": {
"@codemirror/language": "^6.8.0",
"@codemirror/search": "^6.5.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.3",
"@codemirror/language": "^6.10.1",
"@codemirror/search": "^6.5.6",
"@jupyterlab/builder": "^4.2.0",
"@jupyterlab/codeeditor": "^4.2.0",
"@types/codemirror": "^0.0.87",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyterlab>=4.1.0,<5"
"jupyterlab>=4.2.0,<5"
]
dynamic = ["version", "description", "authors", "urls", "keywords"]

@@ -67,7 +67,7 @@ version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.1.0,<5'",
"python -m pip install 'jupyterlab>=4.2.0,<5'",
"jlpm",
"jlpm build:prod"
]
Loading