julia-vim icon indicating copy to clipboard operation
julia-vim copied to clipboard

Movement Between More Blocks

Open jessebett opened this issue 6 years ago • 2 comments

Getting started trying out vim as a julia editing environment. I'm using it by sending code from vim to the REPL with vim-slime.

However, there's something that is slightly annoying.

Right now I can ctrl-c ctrl-c on a function ... end block and it all gets sent to the REPL, great! then to move to the next block I type ]] but if I have code that isn't in a function block (or struct ... end or for ... end or begin ... end) I can not get to it by moving through blocks with ]]

Is this intended behaviour?

It would be nice if I could move to other blocks of julia code that aren't in these sorts of environments.

I really like that in Atom ### comments indicate something like a code block and that ctrl-shift-enter evaluates everything between two ###. Would it be possible to even have this recognized as block delimiters so I can continue moving through my code to slime with a consistent motion?

jessebett avatar Jun 08 '18 21:06 jessebett

I guess you could define blocks of code delimited by ### (or whatever you prefer) by using https://github.com/kana/vim-textobj-user (e.g. forking and modifying one of the plugins listed here, there are several that do something similar, I think it's just a matter of changing the delimiter).

carlobaldassi avatar Jun 08 '18 23:06 carlobaldassi

check out https://github.com/hanschen/vim-ipython-cell does exactly what you want mark areas of code as "cells" which can be sent to vim-slime with some keybindings

ArbitRandomUser avatar Dec 31 '21 08:12 ArbitRandomUser