Skip to content

Commit

Permalink
Merge pull request #74 from peytondmurray/custom-keybindings
Browse files Browse the repository at this point in the history
Add configuration to provide custom keybindings
  • Loading branch information
krassowski authored Feb 5, 2023
2 parents a17e9e0 + 01b3eb0 commit 95da6de
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]

steps:
- name: Checkout
Expand Down
7 changes: 4 additions & 3 deletions modify-keybinds.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Jupyterlab commands don't know about the concept of vim modes so they will be ac
`.jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-editMode`


**Vim remappings**
For vim style remappings (`inoremap`, `imap`, `nmap`...) you can use the sibling extension [jupyterlab-vimrc](https://github.com/ianhi/jupyterlab-vimrc#jupyterlab-vimrc).
### Vim remappings

Beware that this does not work with everything you may have in your standard vimrc. Jupyterlab uses [Codemirror] for the editors in cells. This extension adds vim support by enabling the [vim](https://codemirror.net/demo/vim.html) emulation in codemirror. While this comes with partial support for remappings in your vimrc the support is incomplete.
Vim style remappings (`inoremap`, `imap`, `nmap`...) can be modified in the advanced settings editor under the `Notebook Vim` settings. Alternatively, you can use the sibling extension [jupyterlab-vimrc](https://github.com/ianhi/jupyterlab-vimrc#jupyterlab-vimrc) to do this.

With either approach, Vim remappings do not work with everything you may have in your standard vimrc. Jupyterlab uses [Codemirror] for the editors in cells. This extension adds vim support by enabling the [vim](https://codemirror.net/demo/vim.html) emulation in codemirror. While this comes with partial support for remappings in your vimrc the support is incomplete. In particular, keybindings which use `noremap` don't work [unless the keybinding already exists in the default Codemirror Vim keybindings](https://github.com/codemirror/codemirror5/blob/b2d26b4ccb1d0994ae84d18ad8b84018de176da9/keymap/vim.js#L764-L766). If your keybinding doesn't work with `noremap`, try using `map`, and above all, avoid recursive remappings.
Loading

0 comments on commit 95da6de

Please sign in to comment.