How to edit multiple lines at once

How do I edit over multiple lines like in this video? I have tried this, but ALT minimizes the Rstudio window. Looking to Keyboard Shortcut Quick Reference I am not sure, whether it is there.

In the exactly form like you want I'm not sure.
But in the new version of Rstudio I see this option.

Here you can highlight a part of the code and replace a value by another one quickly, something similar to the video example you posted.
Use find and replace spaces in a box.

I was unaware of this feature and I don't have the latest RStudio. I have RStudio 2023.06.0+421. Here is what I found by trial and error. If I hold the Alt key and select some lines of code with the mouse, I see a cursor at the end of each line. I can put quotes around each line individually if, while still holding the Alt key, I press a key not bound to a shortcut (K works for me) then release the Alt key and type a single or double quote. I can append identical text to each line by selecting text with the mouse while holding the Alt key, pressing the right arrow while continuing to hold the Alt key, releasing the Alt key and typing the desired text. I wouldn't be at all surprised to learn there is a less fiddly way to use the feature.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.