I have tried using "reindent lines" after highlighting the lines but that doesn't work (in fact it removes indentation). For example I want a quick way to
take a script like this
#parameters
b=2
c=1
d=4
q=3
and turn it into this
#parameters
b=2
c=1
d=4
q=3
in Rstudio
Select the lines you want to indent, and. use Ctrl + ] to indent them.
Magic shortcut: Command+I ( Ctrl+I for Windows/Linux) will indent a selected chunk of code.
To indent the first line of a paragraph, put your cursor at the beginning of the paragraph and press the tab key. When you press Enter to start the next paragraph, its first line will be indented.
Highlighting the code of interest and hitting tab should add another level of indentation. Shift-tab will remove a level of indentation.
You could use a shortcut. First, highlight the lines you want to indent, and then press: Ctrl + } (at least, that is the combination on my keyboard).
If you want to move in the other direction, then press: Ctrl + {.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With