randy3k / radian

A 21 century R console
MIT License
1.98k stars 74 forks source link

Pasting text to/from editor #221

Open shirdekel opened 3 years ago

shirdekel commented 3 years ago

Is there a way to yank and paste from radian to an editor (VS Code in my case) and vice versa using vim keybindings? I enabled vim keybindings (in my .Rprofile) and can using them fine separately within radian or VS Code, but cannot yank/paste text across them. The standard cmd+c and cmd+p shortcuts work.

randy3k commented 3 years ago

Ctrl-x ctrl-e? You may need to set the EDITOR environmental variable to VSCode.

randy3k commented 3 years ago

Oh. I misunderstood your question. Ignore the above comment. (By the way, that applies to emacs mode only.

vhpietil commented 3 years ago

Any updates on this? Normally I use Rstudio and my workflow is that I try something on terminal/console, when I get what I like I press up arrow to get the thing I want, ctrl+shift+ left key to select it all, cntr+c to copy it, ctrl+1 to activate editor and then ctrl+v to paste my code there.

I have not found a way to do this using Visual Code, Radian and Windows. From Windows terminal I am able to do that, but when I start radian selecting the text using keyboard only does not work.

tomlue commented 2 years ago

Updating zsh to use xsel worked for me https://unix.stackexchange.com/questions/51933/zsh-copy-and-paste-like-emacs.

But it would be nice if this worked everywhere, maybe possible to use pyperclip? I just want my yanks to be pasteable to a document. Seems like promptoolkit supports custom clipboard https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/examples/prompts/system-clipboard-integration.py