hanschen / vim-ipython-cell

Seamlessly run Python code in IPython from Vim
GNU General Public License v3.0
335 stars 18 forks source link

:IPythonCellPrevCell won't work in visual mode #40

Closed singledoggy closed 11 months ago

singledoggy commented 2 years ago

If it possible to add a feature make it works when using visual mode?

hanschen commented 2 years ago

EDIT: I see now that you specified the command in the title. I'll look into it when I have time - pull requests would also be appreciated.

Previous answer:

What specifically do you want to use it for in visual mode?

To send the selected lines, you can use vim-slime (which you've installed already as a dependency), as illustrated in the Example Vim config provided in the README:

" map <Leader>h to send the current line or current selection to IPython
nmap <Leader>h <Plug>SlimeLineSend
xmap <Leader>h <Plug>SlimeRegionSend
singledoggy commented 2 years ago

Sometimes I need to copy several cells or delete several cells, so it's useful to use the jump function in visual mode. Currently, I choose to add book marks in normal mode then jump in viusal. But it would be better if the jump function can work in visual mode.