luk400 / vim-jukit

Jupyter-Notebook inspired Neovim/Vim Plugin
MIT License
602 stars 23 forks source link

[Feature Request] Jump to next/previous cell #24

Closed igorlfs closed 2 years ago

igorlfs commented 2 years ago

Mappings to jump between cells would be pretty useful for navigation!

luk400 commented 2 years ago

thanks for the suggestion, should be pretty straight forward to implement. I'll get to it in the next few days

luk400 commented 2 years ago

I have now added the functions jukit#cells#jump_to_previous_cell() and jukit#cells#jump_to_next_cell() which should do what you want and which I currently mapped to <leader>K and <leader>J respectively.

Also just fyi, in case you prefer it, you can change the argument in the send-section mapping (nnoremap <leader><space> :call jukit#send#section(0)<cr>) from 0 to 1, which makes it so you automatically jump to the next cell after executing the current cell :)

igorlfs commented 2 years ago

I have now added the functions jukit#cells#jump_to_previous_cell() and jukit#cells#jump_to_next_cell() which should do what you want and which I currently mapped to <leader>K and <leader>J respectively.

Thanks!

Also just fyi, in case you prefer it, you can change the argument in the send-section mapping (nnoremap :call jukit#send#section(0)) from 0 to 1, which makes it so you automatically jump to the next cell after executing the current cell :)

I've been using this, but I still felt the need for a feature specific to dealing with movement, specially when using notebooks with Markdown.