jupyter-vim-binding
jupyter-vim-binding copied to clipboard
RFC: Jump and focus to a previous/next cell by some keyboard shortcut (<C-o><C-o> ?)
When I am working I often realize i need to do some import.
Then i scroll up (ctrl-o, gg), add the import and go want to go back to the previous cell with some shortcut.
Is there any way to achieve something similar? Maybe through cell markers?
It would be really nice feature thanks ;-) I often face similar situation as well.
The following is just an idea, what do you think about it
- Record the history of which cell user was in by
focusorblurevent - Jump forward/backward the history and focus the cell by
<C-o><C-i>and<C-o><C-o>like<C-i>and<C-o>jumps in a native Vim.
If I implement that feature, what you need to do is just hit <C-o><C-o> after.
It would be a bit hard to implement while I need to consider how to handle history correctly so please wait or send me a PR ;-)
So to jump 2 steps in history we would do <C-o><C-o>, <C-o><C-o> ?
In a bit more general setting, would it make sense to use cell metadata to store history/markers? Then they would even work after reloading. Going to cell with marker 'a' could then be <C-o> ' a.
Sorry for late reply.
So to jump 2 steps in history we would do , ?
I think <C-o><C-o> + <C-o><C-o>
In a bit more general setting, would it make sense to use cell metadata to store history/markers? Then they would even work after reloading. Going to cell with marker 'a' could then be ' a.
I agree that it would be nice but the problem is it is a bit difficult to implement while there is no such feature in CodeMirror/Jupyter. That's why I just hit an idea which I explained.
Sorry I missed the code block in my last comment, i was expecting that key sequence exactly.
Ok now I understand that keeping a history of cells might be tricky. I would like to learn a bit more about how the javascript of Jupyter works. Do you know of a good place to get started?
Sorry I missed the code block in my last comment, i was expecting that key sequence exactly.
I see ;-)
Ok now I understand that keeping a history of cells might be tricky. I would like to learn a bit more about how the javascript of Jupyter works. Do you know of a good place to get started?
No. I learned that from the code of Jupyter itself. But it is quite clear so I'm sure that you will get the image pretty soon by reading the source code ;-)