Closed echaya closed 3 years ago
Otherwise, it would be great if the plug-in could support #%%
or ###
natively. Believe this is a more intuitive approach than # BEGIN
and # END
implemented currently.
https://code.visualstudio.com/docs/python/jupyter-support-py for reference.
I actually found :SendLineToREPL<Cr>
when digging into the code. Guess we just need a better documentation than the current one :D
I also see the following but not too sure how to execute it.
if !exists('g:repl_code_block_fences')
let g:repl_code_block_fences = {'python': '# %%', 'zsh': '# %%', 'markdown': '```'}
endif
For your expectation, just add
let g:repl_code_block_fences = {'python': '###', 'zsh': '# %%', 'markdown': '```'}
to .vimrc
and :REPLSendSession
will send whole block to REPL environment.
code between g:repl_code_block_fences['python']
are seen as code block.
You are right. Currently the document is pretty bad. I always came up with an idea and implement some function and forget to write in the document.
code between
g:repl_code_block_fences['python']
are seen as code block.
thanks much for your prompt reply. it works beautifully!
Actually code block are code between g:repl_code_block_fences['python']
and g:repl_code_block_fences_end['python']
.
But by default the latter is the same as the former.
hi,
I've been playing around with the plug-in for a couple of days, and try to adopt it in my daily workflow. I see this plugin is really promising as a go-to REPL solution for many ppl. I'd like to request a
:SendToRepl
command so that it can be used in my .vimrc.The problem with current approach with
let g:sendtorepl_invoke_key = "<F9>"
is that the key defined here can't be used in normal key-binding (correct me if im wrong plz). Following won't work based on my test asF5
wont fire the code to the terminal.My current workflow involves executing code in blocks defined by ###.
I came up with a short keymapping
noremap <s-cr> %?###<cr>vN<F9>
hoping to select the cell block and send the block for REPL. However it doesn't work (where F9 was defined per above). I've also testednoremap <s-cr> %?###<cr>vN<F5>
which doesn't work either.I guess the way
let g:sendtorepl_invoke_key = "<F9>"
assign keystroke for sending code to REPL is diff (im not familiar with VIMScript so didn't look into the detailed code) and can't be used for mappings.So if we could expose a command, e.g.,
:SendToRepl
then I could use it in mynoremap
without typing out the extra keystroke when sending the code.Thanks for your consideration.