Skip to content

Commit

Permalink
Add support for vim mode in Text Editor (#90)
Browse files Browse the repository at this point in the history
* Enable vim mode in file editor

* Fix race condition
  • Loading branch information
krassowski authored Jul 31, 2023
1 parent d935326 commit de8afca
Show file tree
Hide file tree
Showing 6 changed files with 390 additions and 222 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@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",
"@lumino/commands": "^2.0.1",
Expand All @@ -74,6 +75,7 @@
"@codemirror/language": "^6.8.0",
"@codemirror/search": "^6.5.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.3",
"@types/codemirror": "^0.0.87",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
Expand Down
33 changes: 32 additions & 1 deletion schema/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@
"selector": ".jp-Notebook.jp-mod-editMode",
"disabled": true
},
{
"command": "vim:enter-normal-mode",
"keys": ["Escape"],
"selector": ".jp-FileEditor"
},
{
"command": "documentsearch:end",
"keys": ["Escape"],
"selector": ".jp-mod-searchable .jp-FileEditor .cm-vimMode"
},
{
"command": "documentsearch:end",
"keys": ["Escape"],
"selector": ".jp-mod-searchable .jp-Notebook .cm-vimMode"
},
{
"command": "documentsearch:end",
"keys": ["Escape"],
"selector": ".jp-mod-search-active .jp-FileEditor .cm-vimMode"
},
{
"command": "documentsearch:end",
"keys": ["Escape"],
"selector": ".jp-mod-search-active .jp-Notebook .cm-vimMode"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-editMode",
"keys": ["Ctrl O", "U"],
Expand Down Expand Up @@ -256,7 +281,13 @@
"enabled": {
"type": "boolean",
"title": "Enabled",
"description": "Enable/disable notebook vim (may require a page refresh)",
"description": "Enable/disable vim extension (may require a page refresh)",
"default": true
},
"enabledInEditors": {
"type": "boolean",
"title": "Enabled in Text Editor",
"description": "Enable/disable vim in text editors (may require a page refresh)",
"default": true
},
"extraKeybindings": {
Expand Down
Loading

0 comments on commit de8afca

Please sign in to comment.