Open Perlence opened 7 years ago
@Perlence this is actually easy to do with vim-toop plugin. Simply install the plugin with you favorite plugin manager:
Plug 'jeanCarloMachado/vim-toop'
Then add this to you vimrc or init.vim configuration:
call toop#mapFunction('SlimuxSendCode', "gs")
Profit!!, now Slimux works with text objects:
gs2w " Send two words
gs} " Send current line to end of paragraph
gggsG " Send the whole buffer
Also works with visual blocks. Just select the block and then execute the shortcut gs
.
And works with marks too:
mt " set t mark on current line
20j " move 20 lines down
gs't " send all text from current line up to mark t
It would be really great if it was possible to send any text object to REPL. For example, if I bind this function to
gs
, I would be able to send 3 lines withgs2j
, or 2 paragraphs withgs2ap
. Or if I have a text object for entire bufferae
, I could typegsae
to send the buffer.I've come up with this:
Note that it does not work with sub-line text objects, like
iw
.