Paste into RStudio script pane without auto formatting without turning off auto indent?

466 views Asked by At

Is there any way to paste into the RStudio script pane without having the code auto indent itself, AND without turning off the auto indent feature?

Example

The output of dput(iris) looks organised in the console, but spreads very wide when pasted into the script pane. This is not great for code readability, and also for other things like copy/pasting into Stack Overflow or other code editors

In console:

enter image description here

After pasting into script pane:

enter image description here

Notes

  • Similar question and use cases have been put on the RStudio blog, but the main solution seems to be to turn auto indent off in the Tools menu, but I cannot find a temporary solution suitable for intermittent pasting
0

There are 0 answers