sillybun / vim-repl

Best REPL environment for Vim
GNU General Public License v2.0
446 stars 39 forks source link

A couple of improvements request. #135

Open ubaldot opened 2 years ago

ubaldot commented 2 years ago

I love this tool that just work out of the box, however I have a couple of improvements that I wish to suggest. I use gvimwith ipythonas REPLon Windows 10.

  1. Send only one line. At the moment I am using cells delimited by # %%. REPLSendSession sends the whole cell, it would be nice to have a command that sends only the current line as well.
  2. Copy/paste from the REPLto the editor. Imagine that in the REPLyou have something like:

In [1]: A +3

and I want to copy and paste such a command A+3 from the REPLto the editor, it seems that there is no way of doing it. The only way is to do <C-w>N and then yank what I want to copy from the REPLto the editorbut it is very tedious.

arizvisa commented 2 weeks ago

You can use an :tmap with <Cmd> and :normal to add a friendlier interface to your terminal buftype. If you're using Neovim, you can also use <C-\><C-o> (in your map) to execute a single normal mode command and revert back to the original mode.

However, adding a map so you can copy it from other buffer types will probably require using :wincmd or :windo with a conditional.

sillybun commented 2 weeks ago

Sorry for the late reply there is a command SendCurrentLine can meet your first requirement The second function is not implemented currently. I think it's a good idea. I will make an update if I have time.

Barzi2001 @.***> 于2022年4月6日周三 15:44写道:

I love this tool that just work out of the box, however I have a couple of improvements that I wish to suggest. I use gvim with ipython as REPL on Windows 10.

  1. Send only one line. At the moment I am using cells delimited by # %%. REPLSendSession sends the whole cell, it would be nice to have a command that sends only the current line as well.
  2. Copy/paste from the REPL to the editor. Imagine that in the REPL you have something like:

In [1]: A +3

and I want to copy and paste such a command A+3 from the REPL to the editor, it seems that there is no way of doing it. The only way is to do

N and then yank what I want to copy from the REPL to the editor but it is very tedious. — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>