Skip to content

Commit 221bb3b

Browse files
kmdaltonianhi
andauthored
Added "Folding" Keybindings (#4)
Added cell folding keybindings New keybindings z-c : close selected cell code z-o : open selected cell code z-m : close all cell code z-r : open all cell code Fixed language consistency. Co-Authored-By: Ian Hunt-Isaak <[email protected]>
1 parent 95b9345 commit 221bb3b

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

History.md

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

3+
## 0.12.3 / 2020-04-25
4+
5+
* `z c` hides selected code cell
6+
* `z o` shows selected code cell
7+
* `z m` hides all code cells
8+
* `z r` shows all code cells
9+
310
## 0.12.2 / 2020-03-09
411

512
* Change package.json information

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Shortcuts this extension introduces:
9595
| Ctrl-E | Move Cells Down |
9696
| Ctrl-Y | Move Cells Up |
9797
| Z, Z | Center Cell |
98+
| Z, C | Hide Code Cell |
99+
| Z, O | Show Code Cell |
100+
| Z, M | Hide All Code Cells |
101+
| Z, R | Show All Code Cells |
98102

99103
## Contributing
100104

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@axlair/jupyterlab_vim",
3-
"version": "0.12.2",
3+
"version": "0.12.3",
44
"description": "Code cell vim bindings",
55
"author": "Axel Fahy",
66
"license": "MIT",

src/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,26 @@ function activateCellVim(app: JupyterFrontEnd, tracker: INotebookTracker): Promi
593593
keys: ['Z', 'Z'],
594594
command: 'center-cell'
595595
});
596+
commands.addKeyBinding({
597+
selector: '.jp-Notebook:focus',
598+
keys: ['Z', 'C'],
599+
command: 'notebook:hide-cell-code'
600+
});
601+
commands.addKeyBinding({
602+
selector: '.jp-Notebook:focus',
603+
keys: ['Z', 'O'],
604+
command: 'notebook:show-cell-code'
605+
});
606+
commands.addKeyBinding({
607+
selector: '.jp-Notebook:focus',
608+
keys: ['Z', 'M'],
609+
command: 'notebook:hide-all-cell-code'
610+
});
611+
commands.addKeyBinding({
612+
selector: '.jp-Notebook:focus',
613+
keys: ['Z', 'R'],
614+
command: 'notebook:show-all-cell-code'
615+
});
596616
commands.addKeyBinding({
597617
selector: '.jp-Notebook.jp-mod-editMode',
598618
keys: ['Ctrl O', 'Z', 'Z'],

0 commit comments

Comments
 (0)