observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
966 stars 83 forks source link

Shortcuts to run a cell block #70

Closed aaronlelevier closed 5 years ago

aaronlelevier commented 5 years ago

Hi,

I was trying out the Observable online notebooks. They're pretty cool.

I wanted to give some feedback. I use Jupyter notebook a lot, and it has key bindings for "run cell and go to next cell" which is shift+enter. If you want to run the current cell and insert a new cell below, then it's option+enter. I was looking for some key binding shortcuts like this. Do they exist?

Maybe if they are the same key bindings as Jupyter notebook, then the users feel more natural about running the notebooks, since the key bindings are the same.

Just sharing my feedback. Great product, and excited to see where you go with it.

Thanks

mbostock commented 5 years ago

Please see this forum thread for a discussion regarding keyboard shortcuts:

https://talk.observablehq.com/t/list-of-keyboard-shortcuts/89

Here are the current (macOS) keyboard shortcuts:

screen shot 2018-10-11 at 2 46 06 pm

Shift-Enter is also used by Observable to run the current cell. But unlike Jupyter, we have a dataflow runtime, so you don’t typically want to run cells sequentially—when you run one cell, any cell that depends on that cell is run automatically and instantly.

Likewise, we use Option-Enter to split the current cell, which, if the caret is already at the end of the cell, is equivalent to inserting a new cell below the current cell. The “run cell” happens automatically whenever you commit a change to the code, including after you split or merge. You rarely need to run cells manually, though you can Shift-Enter or click the play button for that.

aaronlelevier commented 5 years ago

Thank you for clarifying and also saying about the discussion forum. I understand better now. Thanks.