Skip to content

Commit b765185

Browse files
committed
add cell mode shortcuts following jupyter-vim-binding
1 parent 524a07e commit b765185

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

History.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# History
22

3+
## 0.4.0 / 2018-02-13
4+
5+
* Added Command/Ctrl-{1,2,3} to switch cell mode to code, markdown and raw.
6+
37
## 0.3.0 / 2018-02-12
48

59
* Ex commands ':q' and ':quit' leave vim mode

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab_vim",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Code cell vim bindings",
55
"author": "Jacques Kvam",
66
"main": "lib/index.js",

src/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,21 @@ function activateCellVim(app: JupyterLab, tracker: INotebookTracker): Promise<vo
369369
keys: ['Shift M'],
370370
command: 'merge-and-edit'
371371
});
372+
commands.addKeyBinding({
373+
selector: '.jp-Notebook.jp-mod-editMode',
374+
keys: ['Accel 1'],
375+
command: 'notebook:change-cell-to-code'
376+
});
377+
commands.addKeyBinding({
378+
selector: '.jp-Notebook.jp-mod-editMode',
379+
keys: ['Accel 2'],
380+
command: 'notebook:change-cell-to-markdown'
381+
});
382+
commands.addKeyBinding({
383+
selector: '.jp-Notebook.jp-mod-editMode',
384+
keys: ['Accel 3'],
385+
command: 'notebook:change-cell-to-raw'
386+
});
372387

373388
// tslint:disable:no-unused-expression
374389
new VimCell(app, tracker);

0 commit comments

Comments
 (0)